Copied to clipboard

Flag this post as spam?

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


  • Sandro 45 posts 118 karma points c-trib
    Sep 10, 2009 @ 15:59
    Sandro
    0

    linking a file from media picker

    I'm trying to insert a link to a (video-) file. The user uploads the file into the media section, and selects it with a media picker. I use this in the template:

    <a href='<umbraco:Item field="videoNode" runat="server"  />'>
            <umbraco:Item field="#Download" runat="server" />
    </a>

    This gets me the media node ID - But now...how is it possible to get the relative url based on this media node ID? I tried this:

    <a href='<umbraco:Item field="videoNode" runat="server" xslt="umbraco.library:GetMedia({0},'true')/data[@alias='umbracoFile']" />'>
            <umbraco:Item field="#Download" runat="server" />
    </a>

    but it doesn't work...

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Sep 10, 2009 @ 16:12
    Dirk De Grave
    1

    Sandro,

    use this tutorial on how to configure your media item in your template.

    <umbraco:Item runat="server" 
      field="mediaItem" 
      xslt="concat('&lt;img src=&quot;', umbraco.library:GetMedia({0},'true')/data[@alias='umbracoFile'], '&quot; /&gt;')" 
      xsltDisableEscaping="true" />

    Cheers,

    /Dirk

  • Sandro 45 posts 118 karma points c-trib
    Sep 10, 2009 @ 16:23
    Sandro
    0

    Hi Dirk,

    I knew the tutorial and I tried it about an hour ago. I tried it again, and now it works :O

    It looks (baah! ugly!) like this now:

    <umbraco:Item runat="server" field="videoNode" xslt="concat('&lt;a href=&quot;', umbraco.library:GetMedia({0},'true')/data[@alias='umbracoFile'], '&quot;&gt;')" xsltDisableEscaping="true" />
    <umbraco:Item field="#Download" runat="server" /></a>

    At least it finally works. Thank You!

  • 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