Copied to clipboard

Flag this post as spam?

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


  • Roger 195 posts 474 karma points
    Nov 29, 2012 @ 14:07
    Roger
    0

    Content picker displaying node as link

    Hi all,

    I have a content picker to choose a document from the media folder that I want to be a link - "sidebarLink"
    Instead of the  actual document, the link is showing the node:

    http://stellamaristraining.co.uk/the-training-centre/1103

    Here is the XSLT:

    <xsl:element name="a">
                  <xsl:attribute name="href">
                    <xsl:value-of select="sidebarLink"/>
                      </xsl:attribute>
                        <xsl:value-of select="linkFriendlyName"/>
                      </xsl:element>

    Please can someone help me with the correct XSLT to link to the document itself rather than the node?

    Thanks in advance

    Roger

  • Roger 195 posts 474 karma points
    Nov 29, 2012 @ 15:30
    Roger
    0

    Ok, i've solved this is the Macro XSLT:

                <xsl:if test="sidebarLink !=''">
                    <xsl:variable name="docList" select="umbraco.library:GetMedia(sidebarLink,false())"/>
                        <a href="{$docList/umbracoFile}" target="_blank"><xsl:value-of select="linkFriendlyName"/></a>
                </xsl:if>

    Does anyone know how I can convert this code to inline XSLT so it can be used in a teamplate?

     

    Thanks

  • Roger 195 posts 474 karma points
    Nov 29, 2012 @ 16:23
    Roger
    0

    This is resolved:

    <umbraco:Item runat="server" field="homesidebarLink" xslt="concat('&lt;a href=&quot;', umbraco.library:GetMedia({0},'false')//umbracoFile, '&quot; /&gt;')"
    XsltDisableEscaping="true" /><umbraco:Item field="homeSidebarLinkFriendlyName" runat="server" /></a>

  • 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