Copied to clipboard

Flag this post as spam?

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


  • Jay 2 posts 72 karma points
    Mar 08, 2021 @ 22:39
    Jay
    0

    Access dictionary item from a Component

    Hi,

    Is it possible to access the dictionary from within a component? I can get a reference to the UmbracoContext but am not sure how I can use that to access the UmbracoHelper or to reference a dictionary item.

    All of my searches seem to refer to older versions of Umbraco or require me to access the Dictionary from a view or a controller etc.

    Any help appreciated.

    Thanks, Jay

  • Jay 2 posts 72 karma points
    Mar 13, 2021 @ 13:13
    Jay
    0

    Hi,

    I'm new to the forum and this post was just approved but I have since found how to do this by injecting the IDictionaryService into the component's constructor and using the GetDictionaryItemByKey() method.

    Thanks, Jay

Please Sign in or register to post replies

Write your reply to:

Draft