Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Christian Kragh 14 posts 34 karma points
    Jun 09, 2011 @ 09:35
    Christian Kragh
    0

    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()&lt;='10'">
    <a href='{umbraco.library:NiceUrl(@id)}' title='Test:'>
    <xsl:value-of select="@nodeName"/>
    &nbsp;
    (<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

  • Michael Latouche 504 posts 819 karma points MVP 3x c-trib
    Jun 09, 2011 @ 11:34
    Michael Latouche
    0

    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.

  • Sean Holmesby 61 posts 82 karma points
    Jun 09, 2011 @ 12:31
    Sean Holmesby
    0

    Is it the ' s around the 10? Should it be position() &lt;= 10?

  • Christian Kragh 14 posts 34 karma points
    Jun 09, 2011 @ 14:19
    Christian Kragh
    0

    The function position()&gt;='10' work perfectly...

  • Christian Kragh 14 posts 34 karma points
    Jun 10, 2011 @ 14:19
    Christian Kragh
    0

    I found another solutiuon.

    I created a new documet type equal to my textpages and used it under the person information pages...

    Christian

Please Sign in or register to post replies

Write your reply to:

Draft