Copied to clipboard

Flag this post as spam?

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


  • niccolo rossi 33 posts 53 karma points
    Sep 27, 2011 @ 13:01
    niccolo rossi
    0

    Select with limit

    hi all,

    this select work fine 

    <xsl:variable name="items" select="umbraco.library:GetXmlNodeById(1091)/umbNewsArticle [@isDoc and string(goal) = '1']"/>

    but i have to limit the selection to 5 items! 

    how can i do that?
    thank you

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 27, 2011 @ 13:09
    Fuji Kusaka
    0

    You can use a variable like

    <xsl:variable name="maxItem" select="5"/>


    then in your wrap this in your loop

      <xsl:when test="position() &lt; $maxItem">
        <li>
        <a href="{umbraco.library:NiceUrl(@id)}">
          <xsl:value-of select="@nodeName"/>
        </a>
      </li>
    </
    xsl:when>
Please Sign in or register to post replies

Write your reply to:

Draft