Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all, this is probably really simple but...
I have an XSLT sort for records to show descending
<xsl:sort select="@id" order="descending"/>
The records in the database have now reached over 1000 and the sort has stopped at 999 records.
Here's the full XSLT:
<xsl:variable name="comments" select="UCommentLibrary:GetCommentsForNode($currentPage/@id)//comment"/> <h3> Showing 100 of <xsl:value-of select="count($comments)"/> comment<xsl:if test="count($comments) > 1">s</xsl:if> in our <xsl:value-of select="$currentPage/@nodeName"/> </h3> <ol class="commentlist"> <xsl:for-each select="$comments"> <xsl:sort select="@id" order="descending"/> <xsl:if test="position() <= 100"> <li class="comment" id="comment-{@id}"> <div class="comment-author"> <span class="fn n"> <xsl:value-of select="./name"/> </span> </div> <div class="comment-meta"> Posted <xsl:value-of select="umbraco.library:LongDate(@created,'true',' at ')"/> </div> <p> <xsl:value-of select="umbraco.library:ReplaceLineBreaks(./message)" disable-output-escaping="yes"/> </p> </li> </xsl:if> </xsl:for-each> </ol>
Can anyone help please?
many thanks!
Hi Roger,
Could very well just be that you need to tell the processor to sort numerical (the default is "text" - so you'll find item #1000 at the very end when sorting using descending) - try this:
<xsl:sort select="@id" data-type="number" order="descending" />
/Chriztian
Thanks Chriztian, worked perfectly :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
XSLT Sort Issue
Hi all, this is probably really simple but...
I have an XSLT sort for records to show descending
The records in the database have now reached over 1000 and the sort has stopped at 999 records.
Here's the full XSLT:
Can anyone help please?
many thanks!
Hi Roger,
Could very well just be that you need to tell the processor to sort numerical (the default is "text" - so you'll find item #1000 at the very end when sorting using descending) - try this:
/Chriztian
Thanks Chriztian, worked perfectly :)
is working on a reply...