Copied to clipboard

Flag this post as spam?

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


  • Brian A 13 posts 34 karma points
    Apr 18, 2010 @ 11:30
    Brian A
    0

    Macro to fetch recursively

    I'm very new to XSLT so please bare with me!

    I have this code to fetch me a picture from the media library thus letting the user pick a logo for his site. I have a property at top level where this file is selected and the macro is placed within the Master template - but all nested childs do not load this value?

    <xsl:if test="string($currentPage/data [@alias='homepageLogo']) != '' ">
    <xsl:element name="img">
    <xsl:attribute name="src">

    <xsl:value-of select="umbraco.library:GetMedia($currentPage/data[@alias='homepageLogo'], 'false')/data [@alias = 'umbracoFile']"/>

    </xsl:attribute>
    </xsl:element>
    </xsl:if>

    Any thoughts?

    Thanks in advanced!

    /Brian

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 18, 2010 @ 11:58
    Jan Skovgaard
    0

    Hi Brian

     

    I think you should write this in the GetMedia extension: $currentPage/ancestor-or-self::node/data [@alias = 'homepageLogo']

    Hope this helps

    /Jan

  • Brian A 13 posts 34 karma points
    Apr 18, 2010 @ 12:25
    Brian A
    0

    Hi Jan,

    It works - perfect!

    Thanks!

    /Brian

  • 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