Created
June 23, 2011 14:37
-
-
Save greystate/1042652 to your computer and use it in GitHub Desktop.
Conditional sorting by QueryString values
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:variable name="sortByDate" select="umbraco.library:RequestQueryString('sort') = 'date'" /> | |
<xsl:variable name="sortByName" select="umbraco.library:RequestQueryString('sort') = 'name'" /> | |
<xsl:for-each select="$allTheNodesToShow"> | |
<xsl:sort select="@nodeName[$sortByName]" data-type="text" order="ascending" /> | |
<xsl:sort select="@createDate[$sortByDate]" data-type="text" order="descending" /> | |
<p> | |
<xsl:value-of select="@nodeName" />, created: <xsl:value-of select="@createDate" /> | |
</p> | |
</xsl:for-each> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment