Hey,
I Have the following problem. On my documentype i have a property 'views', this is a numeric datatype.
So I want to list al the nodes of my documenttype and sort them according to the value in 'views'.
Code:
<xsl:for-each select="$currentPage/descendant-or-self::node [@nodeTypeAlias = 'GalleryPage']/descendant-or-self::node [@nodeTypeAlias = 'Movie']">
<xsl:sort select="data [@alias = 'views']" order="descending"/>
<xsl:if test="position() <= $numberOfItems">
<xsl:call-template name="listMovies">
<xsl:with-param name="node" select="."/>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
But the problem is that the items are not in natural order.
For example:
86
8
14
12
0
I think that is because the data [@alias = 'views'] is seen as a String. How can i change this ?
Thanks
Umbraco tips and tricks:
http://www.nibble.be - umbraco mvp 08/09 - certified level 1 & 2 professional