Copied to clipboard

Flag this post as spam?

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


  • Thomas 66 posts 88 karma points
    Feb 24, 2012 @ 10:59
    Thomas
    0

    How do I set a parameter on a macro to the URL of a media file or to a Razor variable?

    Im trying to do a very simple thing: To let users upload a video file to the media section, pick it with a content picker and show it on a page.

    I have a macro that just needs an url to the video:

    <umbraco:Macro htmlID="" css="" posterImageUrl="" sourceMP4="" sourceWebM="" sourceOgg="" videoWidth="" videoHeight="" videoPreload="0" videoAutoplay="0" videoControls="0" downloadLinks="0" Alias="HTML5Video.Video" runat="server"></umbraco:Macro>

    I can get the URL through a Razor Macro, but how do I pass it to the macro above as the sourceMP4  parameter?

    Alternatively - how do I get the URL of the umbracofile and insert it using other methods. Is the answer maybe to be found here:

    http://our.umbraco.org/wiki/reference/templates/umbracomacro-element/macro-parameters/advanced-macro-parameter-syntax

    Umb version 4.7.1

     

  • Jon Boyer 37 posts 59 karma points
    Apr 11, 2012 @ 05:46
    Jon Boyer
    0

    To get the URL of the umbracofile, use the getmedia method in the xslt, eg

     

    umbraco.library:GetMedia($foo, true)/umbracoFile

  • 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