Owain
07/03/2024, 7:30 AMUmbracoPageView
and so doesn't know what Umbraco.GetDictionaryValue
is. It's just has a BlockListItem<>
model assigned to it.
One option that was suggested to me was to inject @inject Umbraco.Cms.Web.Common.UmbracoHelper Umbraco
but then I was told this is potentially unsafe. The other suggestion was to inject @inject ICultureDictionaryFactory _cultureDictionaryFactory
which then gives me access to the dictionary via
var dictionary = _cultureDictionaryFactory.CreateDictionary();
...
@dictionary[DictionaryKey.InteractionsReadMore].IfNullOrWhiteSpace("Read more")
Is one option better than the other or is there a third option that I'm not aware of which is even better / safer.
This is an Umbraco 13 site.Owain
07/03/2024, 8:10 AM@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<BlockListItem<CallToActionGridCard>>
I would be interested to hear peoples thoughts on this approach.