Thanks for that :) really awesome you answered so fast :) To make it even better, just wanted to clear this one a bit.
Lets say, now I just have a macro called "listSubpages" that uses the xslt file with the same name. It simply prints out the list of subnodes As I understood, 1) I include
<xsl:include href="_PaginationHelper.xslt" />
in my simple "listSubpages.xslt" file.
Than I just create "_PaginationHelper.xslt" and save it in XSLT folder with the rest of them. 2) Than (in the same "listSubpages.xslt" file) add a new template
where "Textpage" is a doctype Alias of the actual subpage I am using as childnode.
Now the tricky part: You say: "Call the PaginateSelection template where you want the paged result to appear." and (as I understood) that is right instead of initial autogenerated match="/" template in the same "listSubPages.xslt" file.
As a result, I am getting umbraco xslt editors error, can't save cause there might be a mistake, not sure where and why. This is how my listSubPages.xslt looks like:
And theoretically it should work as you say, strange why I can't call a template from another file if it is included. Not sure what am I doing wrong. Please correct me if I am wrong here :)
Seems I left out an important part of the equation:
When using include files, you need to check the "Skip errors" (or similarly labeled) checkbox when saving, because that process ends up looking for the include file(s) in the wrong place, which of course throws errors all over the place. (I *always* edit my XSLT files outside of Umbraco, so I guess that's why I never thought of mentioning that...)
Also, you will probably run into issues with changes in the included file(s) not taking effect, which is caused by .NET compiling the resulting stylesheet - all you need to do to fix that is install the XSLTouch package and forget about it. Really, it's that cool :-)
Hop this gets you closer to worry-free paged output with XSLT...
I also edit XSLT's in VS, if there is any way out, but just to make sure that XSLT will actually parse, I prefer to edit it in Umbraco :) to make sure it fits ^^.
I wish I could tell you good news, but still something is a miss.
+ Install XSLTouch (check) + Just replase initial match="/" template with one you provided and save via VS. (check)
Than hoping to see the list, but instead am getting xslt "Error reading XSLT file: \xslt\ListChildren.xslt" error text.
Not sure what can be wrong again. And yea, funny notice, After I installed XSLTouch my Localhost started to hang, and crashed several times, had to restart it. Strange, even after I set up a little site (for you to check if possible and make things easier), after XSLTouch installation the site just crashed. :D
XSLTsearch? yes, I know it, it has paging function, and is really good search macro.
I am sure that you could learn alot from any good XSLT example, I know that XSLT file, and it is XXXXL BIG :D. And I really like Chriztian's solution. I think that is the right way to do it.
Speaking of "forking enormous XSLT file" just to make a list page-able. I am sure there must be an easier way out, since allot of people should have encountered the same problem many times before.
Glad to see you're hangin in there - and thanks for plugging the site :-)
Good thing about the XSLT Visualizer in Umbraco is that it gives you the error message(s) from .NET, so have you looked at that?
You should also try adding ?umbDebugShowTrace=True to the URL of the page throwing errors - that will also give you some sort of error message.
Final thought: There was a typo in the first version on GitHub, but I fixed that really quick, so didn't figure you'd have downloaded the file, but that could be the source of error too... if the error message has to do with the namespace prefix "umbraco.library" not defined or similiar, check that you've got the latest version from the GitHubs...
I'll stick with you 'till this works so let me know how it goes.
PS: Regarding the problems with XSLTouch - I've never had any issues like that, but Pete (the developer) will definitely like to hear about it; so if you've got any easy steps to recreate the problem, do send them to him (or open a thread on the project's forum).
Paging in XSLT
Hov is it posible to make paging in XSLT?
I have a large record set that i would like to show on more than one page
Comment author was deleted
Hi,
Check out this example: http://www.nibble.be/?p=11
Thanks very much!
You may also find this example I created helpful (adapted from Tim's):
http://forum.umbraco.org/yafpostst7794Flexible-XSLT-Paging-and-Sorting-Example.aspx
I just tried the pagination from Tim, and most of it works. But is it possible to make it start from page 1 instead of page 0?
I tried to change the value in $pageNumber from 0 to 1, but that didn't do the trick. Can anyone help me with a smart solution to this?
Thanks
-Kim Andersen
Nevermind guys. I got some very nice help from Jan Skovgaard. Thanks again Jan :)
You are welcome Kim :)
Hello everyone :)
I am trying to achieve the same:
http://www.nibble.be/?p=11
But it seams to be not working, not only because of the markup, but also because it is quite old now July 27, 2009.
There are almost no examples since, the most new one I found was
http://our.umbraco.org/projects/developer-tools/paging-xslt
and http://our.umbraco.org/projects/developer-tools/paging-xslt/everything/10636-Any-updates-for-Umbraco-45
but that is more or less it...
I also could use Gridview in user controll, but that is not the goal. I am sure there can be a wayout with xslt.
could use some assistance :)
many thanks in advance.
Dmitrij
Hi Dmitrij,
I just pushed my "_PaginationHelper.xslt" to GitHub - might be what you need :-)
/Chriztian
Hi Chriztian,
Thanks for that :) really awesome you answered so fast :)
To make it even better, just wanted to clear this one a bit.
Lets say, now I just have a macro called "listSubpages" that uses the xslt file with the same name. It simply prints out the list of subnodes
As I understood, 1) I include
in my simple "listSubpages.xslt" file.
Than I just create "_PaginationHelper.xslt" and save it in XSLT folder with the rest of them.
2) Than (in the same "listSubpages.xslt" file) add a new template
where "Textpage" is a doctype Alias of the actual subpage I am using as childnode.
Now the tricky part:
You say: "Call the PaginateSelection template where you want the paged result to appear." and (as I understood) that is right instead of initial autogenerated match="/" template in the same "listSubPages.xslt" file.
As a result, I am getting umbraco xslt editors error, can't save cause there might be a mistake, not sure where and why. This is how my listSubPages.xslt looks like:
And theoretically it should work as you say, strange why I can't call a template from another file if it is included.
Not sure what am I doing wrong. Please correct me if I am wrong here :)
Much appreciated!
Dmitrij
Hi Dmitrij,
Seems I left out an important part of the equation:
When using include files, you need to check the "Skip errors" (or similarly labeled) checkbox when saving, because that process ends up looking for the include file(s) in the wrong place, which of course throws errors all over the place. (I *always* edit my XSLT files outside of Umbraco, so I guess that's why I never thought of mentioning that...)
Also, you will probably run into issues with changes in the included file(s) not taking effect, which is caused by .NET compiling the resulting stylesheet - all you need to do to fix that is install the XSLTouch package and forget about it. Really, it's that cool :-)
Hop this gets you closer to worry-free paged output with XSLT...
/Chriztian
Hi Chriztian,
I also edit XSLT's in VS, if there is any way out, but just to make sure that XSLT will actually parse, I prefer to edit it in Umbraco :) to make sure it fits ^^.
I wish I could tell you good news, but still something is a miss.
+ Install XSLTouch (check)
+ Just replase initial match="/" template with one you provided and save via VS. (check)
Than hoping to see the list, but instead am getting xslt "Error reading XSLT file: \xslt\ListChildren.xslt" error text.
Not sure what can be wrong again. And yea, funny notice, After I installed XSLTouch my Localhost started to hang, and crashed several times, had to restart it. Strange, even after I set up a little site (for you to check if possible and make things easier), after XSLTouch installation the site just crashed. :D
Any idea what is going on? :)
Many many thanks in advance!
Dmitrij
P.S. http://pimpmyxslt.com/ is Awesome!!! Great job! :)
install XSLTsearch and view it, you can learn a lot about xslt.
Hi sun,
XSLTsearch? yes, I know it, it has paging function, and is really good search macro.
I am sure that you could learn alot from any good XSLT example, I know that XSLT file, and it is XXXXL BIG :D. And I really like Chriztian's solution. I think that is the right way to do it.
Speaking of "forking enormous XSLT file" just to make a list page-able. I am sure there must be an easier way out, since allot of people should have encountered the same problem many times before.
Still thanks for advice ;)
Dmitrij
Hi Dmitrij,
Glad to see you're hangin in there - and thanks for plugging the site :-)
Good thing about the XSLT Visualizer in Umbraco is that it gives you the error message(s) from .NET, so have you looked at that?
You should also try adding ?umbDebugShowTrace=True to the URL of the page throwing errors - that will also give you some sort of error message.
Final thought: There was a typo in the first version on GitHub, but I fixed that really quick, so didn't figure you'd have downloaded the file, but that could be the source of error too... if the error message has to do with the namespace prefix "umbraco.library" not defined or similiar, check that you've got the latest version from the GitHubs...
I'll stick with you 'till this works so let me know how it goes.
PS: Regarding the problems with XSLTouch - I've never had any issues like that, but Pete (the developer) will definitely like to hear about it; so if you've got any easy steps to recreate the problem, do send them to him (or open a thread on the project's forum).
/Chriztian
Hi Chriztian,
Guess what, good news!!! :)
I managed to make list pagable (as simple as that) so many thanks for your https://github.com/greystate/Greystate-XSLT-Helpers link!
1 small correction made the trick :)))
in your Github post, part 3) where you have to replace match="/" template part,
There was a closing tag missing in line 3, the final result is supposed to look like this:
And so now it works like a charm, a VERY nice and elegant solution. That is exactly what I was looking for :)
Thanks again!
Dmitrij
Oh my - Good Heavens!
Special commit for you!
Glad you like this way of tackling a problem like this - I kept tweaking the guts out of it to make it possible to "just add pagination" :-)
/Chriztian
is working on a reply...