- Issue created by @larskleiner
- 🇭🇺Hungary nagy.balint
Hi!
As far as I know it is possible at the field setting of the paragraph field to set which paragraphs types are available.
Which even works when reusing the field.While this module allows to restrict further by setting up which paragraphs types (from the allowed ones) are available in each layout or region of the layout.
So for now I am not sure we should change the config, as it is already possible to do, unless I'm missing something.
- 🇭🇺Hungary nagy.balint
I guess the use case here could be if we would like to limit the layouts differently for each content type.
So for content type A, and layout X we would like to allow a type, while not allowing it for layout Y,
but for content type B, and layout X we would not like the allow that type, and lets say allowing it for layout Y.Then of course a further layer of config would be necessary, however I'm not sure if that would not make the config a bit too difficult to manage.
- 🇭🇺Hungary nagy.balint
I guess for something like this to get into the module,
we would need a UI that is similar to what is in metatags module for example, where one can create config sets, and either create a global one, or one for a specific content type that takes precedent. - 🇩🇪Germany larskleiner
Thanks for looking into this.
What you describe in #4 is exactly our use case.
Good suggestion to extend the UI similar to Metatag's config sets. That approach would allow for any entity type to create subsets from the global config and inherit from it.
I'll look into how much time I'd be able to put into an extended patch for this approach.
- 🇦🇹Austria hudri Austria
I don't think the Metatag schema fully applies here. Metatags are one-per-entity, but Layout paragraphs are fields of entities, and there can be multiple entity reference revision fields on a single bundle. So if we start going this road anyway, maybe we should go straight to field level.
Currently we have
layout > region > ...list of paragraphs
The patch changes this tobundle > layout > region > ...list of paragraphs
But I think the proper structure would be the triplet of entity + bundle + field:
entity_type.bundle.field_name > layout > region > ...list of paragraphs
- 🇩🇪Germany larskleiner
I agree it would be good to have the overrides as part of the field config, that's also how it was done in Layout Paragraphs Restriction.
Attached an updated patch, for now just with a bug fix for the previous patch where the schema changes weren't reflected in the JS validation.
- 🇩🇪Germany larskleiner
Another minor update to my patch as the JS validation in #8 did only work on node edit but not on node add forms.