Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

LINK PREVIUS - LINK NEXT

Featured Replies

Hi all,

Can anyone help me?

I want to know how can i do a list of found records with the link next/previous page

i display the records with this code

 <xsl:for-each select="/fmrs:fmresultset/fmrs:resultset/fmrs:record">

<xsl:variable name="record" select="current()"/>

<xsl:value-of disable-output-escaping="yes" select="$record/fmrs:field[@name = 'field1']/fmrs:data[1]"/> - 

<xsl:value-of disable-output-escaping="yes" select="$record/fmrs:field[@name = 'field2']/fmrs:data[1]"/>

<br />

</xsl:for-each> 

is possible to have an xsl example?

sorry for my bad english :crazy:

Thanks,

Hide77

You might do the following:

(- Study an example that you can create with the FM XSLT Site Assistant.)

- Look at page 137 (Appendix C) of the FMSA Custom Web Publishing Guide. In order that the examples described there work, you have to add the cdml2xsl_utilities.xsl file to your solution. You can get this file by converting a CDML solution with the CDML2XSLT conversion tool. I hope you have a CDML solution- but it seems so, because you refered to link-previous and link-next.

I use record navigation blocks so often, that I placed the XSLT code for it into an own file (e.g. with an xsl:template for record navigation) and include the file with xsl:include in the results or details stylesheet. The record navigation is then called with a xsl:call-template .

  • Author

thank you for the answer

now i have another question

how can i make a links pagination like?

page1 - page2 - page3

perhaps is possible with javascript but i dont't know it very well

thanks a lot!!!

hide77

Hmm, that's a design question. If you have just a low number of results, the page scheme can be done. However, if you have a high number (say 500 hits, and say 10 hits per page), shall your navigation look like this?

page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 ? And what is if you get 5000 results?

Or like this? 1 2 3 4 ... 50? And when one clicks 4 one gets maybe 1 ... 3 4 5 6 ... 50 ? What is if i want to go directly to page 30?

Or like this? 1 2 3 4 5 6 7 8 9 10 next, if one clicks next one gets

previous 11 12 13 14 15 16 17 18 19 20 next

You see the problems of all those navigation schemes.

You can do that with JavaScript. But then you rely on the user that he has turned it on in his browser.

But it can also be done server-side with XSLT. However, XSLT does not have loops as we know from other programming languages. This has do to with the fact that XSLT is a functional language and therefore it does not allow for side effects.

In a normal loop construct like this (pseudocode):

maxpages = $foundcount / $current-max

pageloop=1

repeat

<a href="link($pageloop)">page $pageloop</a>

pageloop = $pageloop + 1

until ($pageloop > $maxpages)

The problem is that the variable pageloop is changed, which is not allowed in XSLT to avoid side effects.

Instead one has to use recursion (pseudocode)

maxpages = foundcount / currentmax

call-template page

with-param pageloop=1

with param maxpages=$maxpages

/call-template

template page

param pageloop

param maxpages

if ($pageloop <= $maxpages)

<a href="link($pageloop)">page $pageloop</a>

call-template page

with-param pageloop=$pageloop+1

with-param maxpages=$maxpages

/call-template

/if

/template

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.