Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to Restrict Types of Blocks Shown when Child Blocks are Put into a Tab #513

Open
brianrivet-tilt opened this issue Nov 10, 2021 · 3 comments

Comments

@brianrivet-tilt
Copy link

This is a feature request. I was wondering if it might be possible to set up the feature where you can put the child blocks for a block into a tab so that you can limit the types of child blocks that can go into the tab. Let me give you my use case as that might explain it better:

Let's say I want to set up a Neo field as a page builder, but rather than have a bunch of fields on my content blocks that control things like styling, I would like to have a block type that can be a child on different blocks that is a style customization block, and it can have different children for different types of style customizations with all the fields needed to do the customization. Then I'd like to have a different set of child blocks for actual content children (so for example if I have a block that is a column, be able to have child blocks that are for content like text, images, etc. but then also have a child block available that would let me add style customizations). Then I'd like to be able to put in two tabs on parent block, one for content children, and one for style customizations. Both tabs would be listing child blocks, but the tab with style customizations would only list child blocks that I had marked as being allowed to show in that list, and the content tab would only show blocks I allowed in that list. All of the blocks are children of the current block, but they get shown in a different list depending on how I set the child lists as far as what they can show.

The thinking is that it would allow the user to add style customizations only when needed without having the overhead of all the styling fields on all the different blocks.

@turnstylerj
Copy link

turnstylerj commented Sep 14, 2022

Another handy use case for this, along with the closed issue mentioned above, would be a block with repeatable "row" child blocks where the author could add as many as they'd like/reorder them, but also child block(s) for a "Call to Action" type button that maybe has a couple of block options but is always intended to be used below/separate from the repeatable row blocks.

@ttempleton
Copy link
Contributor

There are no current plans to implement this, but just putting this here so I don't forget, in case this is worked on in the future.

Per the discussion in #753, if this were to be implemented, the idea could be expanded beyond restricting different child block types to different tabs, to allow different child block types to be restricted to different places in the same tab.

@sander-lameco
Copy link

Yes a solution would be to allow multiple Child Block FieldsUI element, and add Child Block limitations/conditions there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants