Copied to clipboard

Flag this post as spam?

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


  • Jan Vermeerbergen 79 posts 112 karma points
    Mar 01, 2012 @ 14:05
    Jan Vermeerbergen
    0

    Pass dictionary item as parameter to macro?

    Is it possible to pass a dictionary item to a macro as a parameter?

    I've got a macro with a button which is used on a couple pages, and want to send the button-text (which is a dictionary item) as a parameter. The text is different on all pages, so fetching the dictionary item from within the XSLT is not really an option...

     

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Mar 01, 2012 @ 14:58
    Tom Fulton
    0

    Hi,

    I don't believe it's possible to pass the dictionary item in directly, however you can pass in the name of the dictionary key and retrieve it from your XSLT.  IE:

    <umbraco:Macro runat="Server" alias="YourMacro" buttonTextKeyName="YourDictionaryKeyName" />
    <xsl:variable name="buttonText" select="umbraco.library:GetDictionaryItem(/macro/buttonTextKeyName)" />

    HTH,
    Tom

  • 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