Hi!
Is there way to sort each level in the menu code (xslt-template)? I think I've only have managed to sort the groups alltogether, not each level in isolation.
Is there a way to accomplish this?
Best regards,
P
Developer forum
E-mail notifications
Sort navigation xslt
Per Ljung
Posted on 21/06/2011 11:43:08
Replies
Nicolai Høeg Pedersen
Posted on 21/06/2011 13:56:19
You can do it in your xslt using xslt sort:
http://www.w3schools.com/xsl/el_sort.asp
http://www.w3schools.com/xsl/el_sort.asp
Per Ljung
Posted on 21/06/2011 14:42:46
You can do it in your xslt using xslt sort:
http://www.w3schools.com/xsl/el_sort.asp
Yes, I know about the xsl:sort function. But not how to use it in the Ecom Navigation xslt-file. The xslt-file uses "depth-first"-logic to recursivly write out the menu items.
menu 1, level 1
menuitem 1, level 2
menuitem 2, level 2
menuitem 3, level 2
menu 2, level 1
menuitem 1, level 2
menitem 2, level 2
So, first it reads menu 1 down to menuitem 3 at level 2, then up till level 1 again and reads menu 2 down to the bottom.
I would need an example how to use the xsl:sort, it's easier to use it in a for-each-loop than in a recurisive algorithm.
Best regards,
Per
Nicolai Høeg Pedersen
Posted on 21/06/2011 17:17:09
That depends on your node selector:
http://www.w3schools.com/xpath/xpath_syntax.asp
http://www.w3schools.com/xpath/xpath_syntax.asp
You must be logged in to post in the forum