I have a simple requirement that I can't figure out with XLST. I have an variable number of nodes. I want to loop through them the pull out a picture and title and show them in a list. I can do that part, but I can't work out how to split it up into pages. I want to show the first 6 nodes, then have a button to show the next 6 or the last 6.
Has anyone done anything similar with XSLT and give me some pointers on how to achieve this?
Many thanks to anyone who can offer help.
Shufflemoomin
I have a simple requirement that I can't figure out with XLST. I have an variable number of nodes. I want to loop through them the pull out a picture and title and show them in a list. I can do that part, but I can't work out how to split it up into pages. I want to show the first 6 nodes, then have a button to show the next 6 or the last 6.
Has anyone done anything similar with XSLT and give me some pointers on how to achieve this?
Many thanks to anyone who can offer help.
Shufflemoomin[/quote]
Here is how I did this with a news letter section I am working on for a site.
I know it's not what you asked for, but as you see from the posts here, paging in xslt can be rather cumbersome.
If your layout permits putting your data in a table paging can be done with a jquery plugin and one line of javascript code on the page with this:
Thank you all for the quick replies. I'll take a look at the information provided later today. Thank you jHauge, that's an interesting little script there.
Paged list?
Hi everyone,
I have a simple requirement that I can't figure out with XLST. I have an variable number of nodes. I want to loop through them the pull out a picture and title and show them in a list. I can do that part, but I can't work out how to split it up into pages. I want to show the first 6 nodes, then have a button to show the next 6 or the last 6.
Has anyone done anything similar with XSLT and give me some pointers on how to achieve this?
Many thanks to anyone who can offer help.
Shufflemoomin
Hi
Perform a search on nibble.be for paging, you'll find some examples on how to use paging in xslt.
Regards,
/Dirk
[quote=shufflemoomin]Hi everyone,
I have a simple requirement that I can't figure out with XLST. I have an variable number of nodes. I want to loop through them the pull out a picture and title and show them in a list. I can do that part, but I can't work out how to split it up into pages. I want to show the first 6 nodes, then have a button to show the next 6 or the last 6.
Has anyone done anything similar with XSLT and give me some pointers on how to achieve this?
Many thanks to anyone who can offer help.
Shufflemoomin[/quote]
Here is how I did this with a news letter section I am working on for a site.
[code]
]>
<>
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
[/code]
As you can see I am showing 9 per page but you can manipulate it to 6 with no worries
I know it's not what you asked for, but as you see from the posts here, paging in xslt can be rather cumbersome.
If your layout permits putting your data in a table paging can be done with a jquery plugin and one line of javascript code on the page with this:
http://www.slashjquery.com/tablepager/index.html
Regards
Jesper Hauge
Thank you all for the quick replies. I'll take a look at the information provided later today. Thank you jHauge, that's an interesting little script there.
is working on a reply...