Copied to clipboard

Flag this post as spam?

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


  • hssdev 5 posts 25 karma points
    Sep 27, 2010 @ 21:33
    hssdev
    0

    Making my node a link

    Hi there,

    Could someone please help me out with my umbraco xslt and fill in the href="" how do i make my randomly selected node a link! thank you very much..

    <a href=""><xsl:value-of select="$quoteNodeSet[position() = $random]/@nodeName" disable-output-escaping="yes"/></a>

  • Lee Kelleher 3945 posts 15163 karma points MVP 10x admin c-trib
    Sep 27, 2010 @ 21:38
    Lee Kelleher
    0

    Hi hssdev,

    In the 'href' of the link, you'd need to use the "NiceUrl" function from the "umbraco.library". However since you are trying to access a random node, it's probably best to store the node in a variable, like so:

    <xsl:variable name="randomNode" select="$quoteNodeSet[position() = $random]" />
    <a href="{umbraco.library:NiceUrl($randomNode/@id)}">
        <xsl:value-of select="$randomNode/@nodeName" disable-output-escaping="yes"/>
    </a>

    Then you can access the random node multiple times.

    Cheers, Lee.

  • hssdev 5 posts 25 karma points
    Sep 27, 2010 @ 21:52
    hssdev
    0

    wonderful, thank you so much

  • 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