-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a Dictionary Constants Class containing alises #220
Comments
Well, Models Builder is meant to create models... not only for And then, we can discuss it here. Going from
In other words, align the dictionary API with what we already have for content models? |
I think bringing the API in line with content models would be nice but it would still be useful to expose the alias/meta as well. What if you wanted to access Filters for example and then Locations?
I don't think that would work would it? Also, Something that would need to be considered is people giving dictionary items non-code friendly names. At the moment the "name" is the alias and it also doesn't respect hierarchy. So you can create
And that generates aliases of "Filters" and "UK Regions", so it would need to consider that. |
That could work with a clever combination of properties and extension methods. Whether it's a nice way... is a different question. Now, you are right about exposing aliases too. So we'd have both aliases, and values. The structure question is interesting. Assume I create the following structure:
I guess you could get the alias with How would we then get the alias for "UkRegions"? And then we can generate
And use as
throwing random ideas here, will need to think about it - happy to hear more ideas & comments |
Hey Stephan,
So I have an idea that would be really useful but it's "slightly" outside the scope of Models Builder. However would work in a similar way.
Thinking along the lines of #215
However, the idea is to create a dedicated Class that exposes all the aliases configured in the dictionary. Maybe generate a class called DictionaryConstants.
Then use the Dictionary structure to generate nested class structures, with some logic to handle naming conventions..
e.g. Dictionary entry with name "Filters.Locations" would generate DictionaryConstants.Filters.Locations and that value would be "Filters.Locations" as that is what the dictionary alias is in Umbraco.
Reason:
Save people having to do
@Umbraco.GetDictionaryValue("SomeAlias","Fallback value")
instead they can do@Umbraco.GetDictionaryValue(DictionaryConstants.Filters.Locations, "Fallback Value")
Do you think the underlying tech of Models Builder could be used to do this?
The text was updated successfully, but these errors were encountered: