Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi i want to show the label on page from dictionary as per language selected. my form is loaded through view component.
Is it possible to use @Umbraco.GetDictionaryValue("myKey") in razor page of view component?
@Umbraco.GetDictionaryValue("myKey")
or any other way to get the Dictionary value in view component?
In a view you can inject Umbracohelper
@inject UmbracoHelper umbracoHelper
and then use
@umbracoHelper.GetDictionaryValue("Dictionarykey")
Or you could inject the helper in the _ViewImports.cshtml so you dont need to inject it manually in each view if you need to use it often.
Any update to get the value in the controller? I need it to add error states to the model.
I used the ILocalisationService, but cannot get the value from the current language, it feels like i am missing something simple
Hi Lander Debeuf, please read this article. You will find the answers here: https://docs.umbraco.com/umbraco-cms/reference/querying/umbracohelper
is working on a reply...
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.
Continue discussion
How to get Dictionary value in viewComponent razor page in umbraco 9
Hi i want to show the label on page from dictionary as per language selected. my form is loaded through view component.
Is it possible to use
@Umbraco.GetDictionaryValue("myKey")
in razor page of view component?or any other way to get the Dictionary value in view component?
In a view you can inject Umbracohelper
@inject UmbracoHelper umbracoHelper
and then use
@umbracoHelper.GetDictionaryValue("Dictionarykey")
Or you could inject the helper in the _ViewImports.cshtml so you dont need to inject it manually in each view if you need to use it often.
Any update to get the value in the controller? I need it to add error states to the model.
I used the ILocalisationService, but cannot get the value from the current language, it feels like i am missing something simple
Hi Lander Debeuf, please read this article. You will find the answers here: https://docs.umbraco.com/umbraco-cms/reference/querying/umbracohelper
is working on a reply...
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.