cofoundry-cms / cofoundry

Cofoundry is an extensible and flexible .NET Core CMS & application framework focusing on code first development
https://www.cofoundry.org
MIT License
835 stars 146 forks source link

Custom settings per custom entity definition #552

Open HeyJoel opened 2 weeks ago

HeyJoel commented 2 weeks ago

This was raised in a comment to issue 243.

A custom-entity-level settings object - so each custom entity type gets a single settings object, again with the purpose of allowing the editor to specify common labels, error messages etc for all instances of that custom entity. My naïve expectation for how this might be defined would be something like MyCustomEntity : ICustomEntityDefinition<MyCustomEntityModel, MyCustomEntitySettings>

So using a "Blog Post" custom entity as an exampe, a developer would want to definine a corresponding blog post settings model to define global settings for all blog post custom entities e.g. translations for global terms like "Blog Post" or a configuration setting like the page size to use on the list page.

I don;t think we'd want to use generics on the definition type as suggested in the comment as extra generic types can cause more problems, but some other type reference could be used. There would also need to be a new way to access the configuration settings - perhaps accessed from the custom entity list page.