Hi everyone,
I'm working on a Volto add-on where I need to create a custom content type that should consist of only two blocks: a title block and a listing block.
Here's what I've done so far:
- Initialization: I'm using
initialBlocksto initialize the content type with the title and the listing block. - Overwrite the Title Block Edit Component: I’ve allowed
disableNewBlocksto be true ifdata?.disableNewBlocksis true in Title. - Manual Configuration: In the Volto content type editable layout, I manually set the
requiredanddisableNewBlocksproperties to true for these blocks. This ensures that no additional blocks can be added, and the two initial blocks are required.
My Questions:
- Automating required and disableNewBlocks: Is there a way to automatically configure
requiredanddisableNewBlocks(i.e., via schema, FTI etc.) for these blocks when the content type is created, so the user doesn't have to set these properties manually in the content type layout? - Component Shadowing for the Custom Content Type Only: Is there a way to overwrite the title component for the custom content type only so that it has no effects on others?
- Alternative Approaches: Is there another, possibly better, way to enforce that the content type should only contain these two blocks, without allowing the addition of any other blocks?
Thanks for any insights or suggestions!