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 4500 posts 18255 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.

  • Comment author was deleted

    Sep 26, 2013 @ 18:30

    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

Please Sign in or register to post replies

Write your reply to:

Draft