Default Setups & Validation in Block Grid Editor
d
Hi Umbraco Community, I'm currently tackling a project involving the Block Grid editor for content creation. The client has a clearly structured page hierarchy and specific Hero Blocks for different page types. They envision a feature where the appropriate Hero Block is pre-selected as the first block when creating new content (a default setting). Question: Is there a way to implement default setups for blocks, or alternatively, validation to guide editors in making the Hero Block the first content block before enabling Save/Publish? Any help is greatly appreciated!
m
Are you aware of content templates (or blueprints as they used to be called)? https://docs.umbraco.com/umbraco-cms/fundamentals/backoffice/content-templates Might be a simple no code or plugins, out of the box compromise, although not exactly a default value, like you are after.
If the functionality is more along the lines of have the default hero frontend there if the grid is empty, then if the doctypes have their own templates then you can simply have a render the hero in the template (or check for the doctype alias if a shared template) and render without having to have it explicitly in the grid. Though obv that means the editor needs to add the hero when they come to actually populate the grid.
Might also need to use in conjunction with https://docs.umbraco.com/umbraco-cms/reference/notifications/determining-new-entity#checking-if-its-new As could well be the case that an empty value might be intended, so can't use that as a flag for inject the default?
d
Thanks for your reply Mike, will look deeper into it 🙂
3 Views