Skip to content

Create a Dictionary Constants Class containing alises #220

Open
@NikRimington

Description

@NikRimington

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions