Is it not possible to place your if test in your top dor-each select?
Otherwize, you might build a second for-each loop right under the first one with your if test as select. And then do the sorting and all the rest.
Another option maybe, but I am not sure if this is possible with xslt, is using a local variable as a counter. Then your test on position < 10 would become a test on counter < 10.
Newest pages list
Hey.
I want to create a list of all pages sorted by creation date...
front
- Text
- Text
- List
- Text
- Text
All pages under list are hidden and are not to be shown...
I use this code, but how can i do something like this?
<xsl:for-each select="$currentPage/ancestor-or-self::root/Home/descendant-or-self::* [@isDoc and string(umbracoNaviHide) != '1' and umbraco.library:HasAccess(@id,@path)]">
<xsl:sort select="@updateDate" order="descending" />
<xsl:if test="position()<='10'">
<a href='{umbraco.library:NiceUrl(@id)}' title='Test:'>
<xsl:value-of select="@nodeName"/>
(<xsl:value-of select="name(.)"/>)
</a>
</xsl:if>
</xsl:for-each>
If I use a IF statement with this, "parent::* [name(.) != 'PersonSide']", inside the for-each the method works, but then I dont get 10 records.
Christian
Hi Christian,
Is it not possible to place your if test in your top dor-each select?
Otherwize, you might build a second for-each loop right under the first one with your if test as select. And then do the sorting and all the rest.
Another option maybe, but I am not sure if this is possible with xslt, is using a local variable as a counter. Then your test on position < 10 would become a test on counter < 10.
Cheers,
Michael.
Is it the ' s around the 10? Should it be position() <= 10?
The function position()>='10' work perfectly...
I found another solutiuon.
I created a new documet type equal to my textpages and used it under the person information pages...
Christian
is working on a reply...