Copied to clipboard

Flag this post as spam?

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


  • panos polis 2 posts 22 karma points
    May 31, 2011 @ 10:38
    panos polis
    0

    Document type and paging

    Im new to umbraco and i wan to make a list with news ..showing only 10 per page

    how can i do this..and i dont want to retrieve all the records from database and do the paging with xslt..is there any way to retrieve only 10 records per page?

     

    thanx

  • Daniel Bardi 927 posts 2562 karma points
    May 31, 2011 @ 11:30
    Daniel Bardi
    0

    You can use the postion() value to determine nodes to show

    pass in first and last positions.

    Not sure if this will solve your issue, but should give you and idea to start from.
    It's late and there might be a better solution if thought on more... 

    <xsl:variable name="first" select="number(/macro/firstPosition) - 1/>  <!-- send in 1  -->
    <xsl:variable name="last" select="number(/macro/lastPosition) + 1"/> <!-- send in 10 -->
    <xsl:foreach select="$currentPage/ancestor-or-self/NewsItem [position() &gt; $first and position() &lt; $last]">
     <!-- show news item info -->
    </xsl:foreach>
Please Sign in or register to post replies

Write your reply to:

Draft