Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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...
Sandro,
use this tutorial on how to configure your media item in your template.
<umbraco:Item runat="server" field="mediaItem" xslt="concat('<img src="', umbraco.library:GetMedia({0},'true')/data[@alias='umbracoFile'], '" />')" xsltDisableEscaping="true" />
Cheers,
/Dirk
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('<a href="', umbraco.library:GetMedia({0},'true')/data[@alias='umbracoFile'], '">')" xsltDisableEscaping="true" /><umbraco:Item field="#Download" runat="server" /></a>
At least it finally works. Thank You!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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...
Sandro,
use this tutorial on how to configure your media item in your template.
Cheers,
/Dirk
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:
At least it finally works. Thank You!
is working on a reply...