Copied to clipboard

Flag this post as spam?

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


  • Roger Hughes 55 posts 88 karma points
    Feb 09, 2010 @ 15:45
    Roger Hughes
    0

    Related Link issue

    Hi guys,

    I am trying to display a related link on a page but from a macro due to multiple languages.

    The whole site works but I cant get anything to display for the link. do I need to wrap it in a HTML anchor?

    This is my link in the XSLT:

    <xsl:value-of select="data [@alias = concat ('aboutusLink',$flang)]"/>

    Thanks

    Roger

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Feb 09, 2010 @ 15:50
    Nik Wahlberg
    0

    Simple and perhaps obvious, but have you checked to make sure your concat is generating what you expect (correct field name)? 

    THanks,
    Nik

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Feb 09, 2010 @ 15:59
    Dirk De Grave
    0

    Hi Roger,

    Output of a related links datatype is an xml snippet, so you don't see anything unless you look at the source of the page, then you'll notice a small xml snippet representing all related links. 

    <links><link title="a" link="b" type="c" newwindow="d"/></links>

    So, you'll need to iterate your links in order to display the data. 

    <xsl:for-each select="data [@alias = concat ('aboutusLink',$flang)]/links/link">
      <xsl:value-of select="@title"/>
    </xsl:for-each>

     

    Also, there's a template available from the template dropdown when creating a new xslt ('Related Links'), and that one should give you a start on how to show the related links on your site.

     

    Hope this helps.

    Regards,

    /Dirk

  • Roger Hughes 55 posts 88 karma points
    Feb 09, 2010 @ 16:32
    Roger Hughes
    0

    Hi Guys,

    I got it working with Dirks solution but I have to add $currentPage in order to get it to display.

    <xsl:for-each select="$currentPage/data[@alias = concat('aboutusLink',$flang)]/links/link">

    Many thanks!

    Roger

  • 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