Copied to clipboard

Flag this post as spam?

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


  • Anders 27 posts 47 karma points
    Aug 29, 2009 @ 18:12
    Anders
    0

    Write 5 postes and order by date

    Hello again again,

    How can i f.ex. write 5 postes in xslt - i mean, i have made a news system, and they are in a subfolder. I have made a archive witch just write all off them. I would just like to write 5. And how can i order by date?

    Greetings Anders

  • Ricky Beard 61 posts 116 karma points
    Aug 29, 2009 @ 18:52
    Ricky Beard
    3

    If I understand your question correctly, I think you can do this (you may have to alter the select XPATH for your needs):

     <xsl:for-each select="$currentPage//node">
      <xsl:sort select="@createDate" order="descending" />
      <xsl:if test="position() &lt; 6">
        Put your post markup here...
      </xsl:if>
    </xsl:for-each>

    This will sort the nodes newest to oldest and only show the first 5.

  • Anders 27 posts 47 karma points
    Aug 29, 2009 @ 19:10
    Anders
    0

    Thanks

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies