Copied to clipboard

Flag this post as spam?

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


  • Matt Taylor 873 posts 2086 karma points
    Nov 17, 2010 @ 15:18
    Matt Taylor
    0

    Related Links or multi content picker?

    The website I'm working on has a related links section on every page which will list a chosen selection of related pages displaying a thumbnail image, title and summary text for each one (stored in the content's document type).

    I thought I was going to have to use some sort of multi-content picker to implement this but I've just come accross the 'Related Links' datatype.

    I've watched the video about 'Related Links' and seen you can get the caption and url quite easily in the XSLT macro you create but I'm not sure how easily it would be to get the @pageID for the related content item which I would need in order to get the thumbnail image src and summary for display.

    Is that information stored by the 'Related Links' datatype?

    Thank you.

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Nov 17, 2010 @ 15:37
    Tom Fulton
    1

    Hi Matt

    If you're adding the related page as an "Internal Link" in the Related Links datatype, it will store the nodeid in the @link attribute.  You could then use umbraco.library:GetXmlNodeById to retrieve that node and get the thumbnail image/summary/etc.

      <xsl:for-each select="$currentPage/relLinks/links/link">
        <xsl:variable name="targetXml" select="umbraco.library:GetXmlNodeById(./@link)"/>
        <xsl:value-of select="$targetXml/pageSummary"/>
      </xsl:for-each>

    You could also use the same approach with something like Multi Node Tree Picker from uComponents

  • Matt Taylor 873 posts 2086 karma points
    Nov 17, 2010 @ 16:31
    Matt Taylor
    0

    Thank you Tom,

    Nice to be re-assured I wasn't going down the wrong track.
    I did come accross that uComponents package in my research and it does have some advantages over the 'Related Links' datatype.
    I like the ability to add external links though which the 'Related Links' datatype supports.

Please Sign in or register to post replies

Write your reply to:

Draft