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 4026 posts 15836 karma points MVP 13x 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

Please Sign in or register to post replies

Write your reply to:

Draft