Copied to clipboard

Flag this post as spam?

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


  • Kasper Dyrvig 246 posts 379 karma points
    Aug 11, 2010 @ 16:00
    Kasper Dyrvig
    0

    Get specific number of random nodes from a variable parent

    I have searched a lot for a clear answer. But I think I have to ask: How do I view 8 random nodes from a variable parent?

    Thank you...

  • Kasper Dyrvig 246 posts 379 karma points
    Aug 11, 2010 @ 16:14
    Kasper Dyrvig
    0

    Okay, now I got my XSLT to view the nodes. What I need now is so view only 8 of them and in random order.

    <xsl:for-each select="umbraco.library:GetXmlNodeById(@parentID)/*">
        <p>
          <href="/skiferie?stay={@nodeName}"><xsl:value-of select="@nodeName" /></a></p>
    </xsl:for-each>

  • Kasper Dyrvig 246 posts 379 karma points
    Aug 11, 2010 @ 16:33
    Kasper Dyrvig
    0

    This is getting wired...

    <xsl:for-each select="umbraco.library:GetXmlNodeById(@parentID)/*">
        <xsl:if test="position() &lt; 8">
          <p>
            <href="/skiferie?stay={@nodeName}"><xsl:value-of select="stayName" /></a></p>
        </xsl:if>
      </xsl:for-each>

    That doesn't return enything... If I remove the if-test, I get all the content I need (and more).

    Any one who has an idea? 

  • 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