I have an some XSLT creating an HTML page by pulling information from a number of different nodes around the whole site.
This is also using paging so that only 10 results are shown each page.
I am trying to add a dropdown, currently an HTML select statement, so that the results can be sorted, but am stuck as to how to get the selected value into the XSLT to then change the sort order.
Hopefully this makes sense. I have posted the whole code below.
Hi there, it looks like you're trying to sort the content by several different columns and direction. I would suggest the following combination of changes:
Make your select auto postback (to self) and set 2 URL paramaters dir=ASC|dir=DESC and column={columnName}
Use umbraco.library:RequestQueryString('String key') to snag the current values
Set the root data select into a local variable that is set and looped through in a case statement (<xsl:choose>), do a copy-of (<xsl:copy-of select==="." />)
in your for-each, loop over the variable in msxsl:node-set($variableContainingSortedNodesFromCaseStatement)
This would be my approach since you can't stick xsl:sort tags as children of any other tag. HTH.
Getting value from HTML select to use in XSLT
I have an some XSLT creating an HTML page by pulling information from a number of different nodes around the whole site.
This is also using paging so that only 10 results are shown each page.
I am trying to add a dropdown, currently an HTML select statement, so that the results can be sorted, but am stuck as to how to get the selected value into the XSLT to then change the sort order.
Hopefully this makes sense. I have posted the whole code below.
Hi there, it looks like you're trying to sort the content by several different columns and direction. I would suggest the following combination of changes:
is working on a reply...