Copied to clipboard

Flag this post as spam?

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


  • Matthew Schragal 13 posts 25 karma points
    Jul 13, 2010 @ 01:50
    Matthew Schragal
    0

    GetMedia problems with legacy schema in Umbraco 4.5

    I cannot get GetMedia working in an XSLT macro when using the 4.5 release with the legacy schema.

    Here's my code:

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

    Where 1070 is a Media item of type Image.  The code returns nothing.

    Any ideas???

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jul 13, 2010 @ 01:56
    Lee Kelleher
    0

    Hi Matthew,

    Try adding the node name to the XPath...

    <xsl:value-of select="umbraco.library:GetMedia(1070, 0)/node/data[@alias='umbracoFile']" />

    or failing that, try using the nodeTypeAlias (from the new schema - this is guesswork).

    <xsl:value-of select="umbraco.library:GetMedia(1070, 0)/Image/data[@alias='umbracoFile']" />

    Good luck!

    Cheers, Lee.

  • Matthew Schragal 13 posts 25 karma points
    Jul 13, 2010 @ 15:46
    Matthew Schragal
    0

    Lee,

    You nailed it!  Thanks so much.

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft