Copied to clipboard

Flag this post as spam?

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


  • Yannick Smits 321 posts 718 karma points
    Sep 26, 2013 @ 17:28
    Yannick Smits
    0

    GetDictionaryItem not working in MacroPartials

    I'm trying to get a dictionary item inside a .cshtml. The cshtml is loaded in a macro and resides in the ~/Views/MacroPartials directory.

    @umbraco.library.GetDictionaryItem("Practitioner")

    For some reason it always gives back the english key.

    When I use the same code inside a ~/MacroScripts razor file it loads the correct dutch key on the dutch site.

    What am I missing? I'm using Umbraco 6.1.3

  • Dennis Aaen 4457 posts 17970 karma points admin hq c-trib
    Sep 26, 2013 @ 17:54
    Dennis Aaen
    0

    Hi Yannick,

    Maybe this documentation can help you get it to work 

    http://our.umbraco.org/documentation/reference/templating/macros/razor/using-dictionary-items

    /Dennis

  • Yannick Smits 321 posts 718 karma points
    Sep 26, 2013 @ 17:56
    Yannick Smits
    0

    not really, the first 2 options just give errors, the 3rd one I'm already using.

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Sep 26, 2013 @ 18:30
    Tim Geyssens
    0

    Try @Umbraco.GetDictionaryValue("Key")

  • Yannick Smits 321 posts 718 karma points
    Sep 26, 2013 @ 19:01
    Yannick Smits
    100

    oeps was my stupid mistake. Updated in the wrong place...:S

  • 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