Copied to clipboard

Flag this post as spam?

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


  • Rik Helsen 670 posts 873 karma points
    Mar 18, 2010 @ 13:38
    Rik Helsen
    0

    passing a mediaitemURL to a macro as parameter (in a masterpage)

    I use a mediapicker to select a headerimage that should be passed on to a macro containing a flash header animation. Now i've found in the documentation that this is possible if i use square brackets like this:

    <umbraco:macro alias="Flasheader" pagevalue="[#HeaderImage]" runat="server"/>

    But this ofcourse renders the headerimage nodeId instead of the url to the image...

    Is there a way to include the url instead of just the ID ? in xslt it's quite easy thanks to the umbraco.library:GetMedia function, but how could i use this here?


    All help is very much appreciated!

    Rik

  • Rik Helsen 670 posts 873 karma points
    Mar 18, 2010 @ 13:57
    Rik Helsen
    0

    I was hoping something like this would be possible:

    <umbraco:Macro ProductionXMLDataHandler="/xml/production.ashx" FlashBanner="[$HeaderImage/data [@alias=$umbracoFile]]"  CalendarXMLDataHandler="/xml/calendar.ashx" Alias="Top_navigation_flash" runat="server"></umbraco:Macro>

    But i'm afraid not... any advice ?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Mar 18, 2010 @ 14:53
    Dirk De Grave
    0

    I still don't see any advantage here of passing the url rather than the id of the media item? Just pass the id and get the url from either user control or xslt. You need to query the database anyway as the paths aren't stored in published xml (unless you use an upload field)

     

    Cheers,

    /Dirk

  • Rik Helsen 670 posts 873 karma points
    Mar 18, 2010 @ 15:05
    Rik Helsen
    0

    Our usercontrols are kept platformindependent... so if we want to use it in sharepoint or umbraco it should always work ...

     

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Mar 18, 2010 @ 15:22
    Dirk De Grave
    0

    And that sounds like a great reason...

    How about creating a new parameter type... which accept an integer and your new macro type would be responsible for passing the url of the media item associated with the id through the 'Value' property

    Parameter types implement the IMacroGuiRendering interface

    Hope this helps.

    Regards,

    /Dirk

Please Sign in or register to post replies

Write your reply to:

Draft