Copied to clipboard

Flag this post as spam?

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


  • Pankaj Sharma 11 posts 51 karma points
    Oct 21, 2011 @ 12:10
    Pankaj Sharma
    0

    How to pass Page Field as a variable in Umbraco Macro

    Hi There ,

     

    I have a problem while using Insert_video_1.0.2 package in Umbraco 4.7

    I use the macro to insert a youtube video like this & it works :-

    <umbraco:Macro SourceUrl="www.youtube.com/watch?v=RjrEQaG5jPM" MaxWidth="400" MaxHeight="300" Alias="OEmbed" runat="server"></umbraco:Macro>

     

    It works with direct youtube link.

    But problem is  now I want to insert youtube link from Admin Panel  i.e as a page field,textstring  (vIDEOURL) like this  .

    I have tried everything  :-

    <umbraco:Macro SourceUrl="<umbraco:Item field="vIDEOURL" runat="server"></umbraco:Item>" MaxWidth="400" MaxHeight="300" Alias="OEmbed" runat="server"></umbraco:Macro>

     

    and

    <umbraco:Macro SourceUrl='<umbraco:Item field="vIDEOURL" runat="server"></umbraco:Item>' MaxWidth="400" MaxHeight="300" Alias="OEmbed" runat="server"></umbraco:Macro>

    and

    <umbraco:Macro SourceUrl= <a href="/<umbraco:Item field="vIDEOURL" runat="server"></umbraco:Item> "</a>MaxWidth="400" MaxHeight="300" Alias="OEmbed" runat="server"></umbraco:Macro>

     

     

    from Last one I got youtube url ( in the browser's page source)  like this  /www.youtube.com/watch?v=RjrEQaG5jPM    but   there was no video .

     

    Please provide the proper syntax & how it work.

     

    Thanks

     

  • Rodion Novoselov 694 posts 859 karma points
    Oct 21, 2011 @ 12:32
    Rodion Novoselov
    0

    Hi. You need to use '[#vIDEOURL]' as a macro parameter value like this:

    <umbraco:Macro SourceUrl="[#vIDEOURL]"
     MaxWidth="400" MaxHeight="300"
    Alias="OEmbed" runat="server"/>

    More details about possible macro parameter substitutions you can get here:

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

  • Pankaj Sharma 11 posts 51 karma points
    Oct 21, 2011 @ 12:44
    Pankaj Sharma
    0

    it works

    Thanks man..thank you so much. thats why i love Umbraco...... 

  • Alpesh 5 posts 25 karma points
    Oct 21, 2014 @ 09:20
    Alpesh
    0

    How can i use recursive="true" with this

    <umbraco:macro alias="RenderProperties" pagevalue="[#bodyText]" runat="server"/>

    macro?

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Oct 21, 2014 @ 09:25
    Dennis Aaen
    0

    Hi Alpesh and welcome to our,

    If I remember correctly you can make the property recursive by doing this:

    <umbraco:macro alias="RenderProperties" pagevalue="[$bodyText]" runat="server"/>

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

    Hope this helps,

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft