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
Under Umbraco 7 I used to have a method that would get a dictionary label and return the correct value. It used to be done with UmbracoHelper. How can this be done in Umbraco 8 now?
This is the old method:
public static string GetLabel(string label)
I have seen a number of other posts recommending using Umbraco. but this doesn't seem to work as I see no methods. Thank you for any help!
In my views in V8 I'm doing Umbraco.GetDictionaryValue("DictionaryItemAlias","FallBackValue")
In a view Umbraco is an exposed version of an UmbracoHelper much in the same way you are using it in your static method so it should still be possible.
Some thing to be aware of, ideally you shouldn't be creating your own instance of the Umbraco helper, you could consider creating an Extension method though.
public static string GetLabel(this UmbracoHelper helper, string label)
This would rely on you having an instance of an UmbracoHelper which, hopefully, you aren't creating an instance of but using an already existing instance either from your view, your controller, or injected via dependency injection into custom code.
Thank you so much Nik. Made progress. I have one of those precompiled versions so had to change stuff all over the place. Looks like it is on the right track though. Thank you!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted