Copied to clipboard

Flag this post as spam?

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


  • Ron Brouwer 273 posts 768 karma points
    Feb 10, 2010 @ 16:32
    Ron Brouwer
    0

    Passing dictionaryitem into a macro.

    Hi,

    I need to use an dictionaryitem inside my macro (UserControl). Not using code but as parameter.

    <

     

    umbraco:Macro ButtonText="Search" QueryText="Keywords" FromText="From" ToText="To" ....

    I need to use somthing like:

    <

     

    umbraco:Macro ButtonText="[#@$%Search]" QueryText=[#@$%"Keywords]" FromText="[#@$%From]" ToText="[#@$%To]"

    Is the a syntax for this problem?

    Thanks

  • Richard Soeteman 4049 posts 12922 karma points MVP 2x
    Feb 10, 2010 @ 17:20
    Richard Soeteman
    1

    Hi Ron,

    I think not. Normaly you prefix a dictionary item with a #. Now this is also the prefix to pass a paramter to the macro, so this won't work. Now what you can do is pass the dictionary key to the User control and use umbrac.library.GetDictionaryItem to get the value.

    Cheers,

    Richard

  • Ron Brouwer 273 posts 768 karma points
    Feb 11, 2010 @ 13:48
    Ron Brouwer
    0

    I did'nt want to change the code but umbraco leaves me no choise..

    Thanks Richard.

  • Ron Brouwer 273 posts 768 karma points
    Feb 11, 2010 @ 13:55
    Ron Brouwer
    0

     

    public string QueryText

    {

     

    get { return ltrQuery.Text; }

     

    set { ltrQuery.Text = library.GetDictionaryItem(value); }

    }

Please Sign in or register to post replies

Write your reply to:

Draft