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

Conditional child blocks #775

Open
FlipLucky opened this issue Aug 21, 2023 · 2 comments
Open

Conditional child blocks #775

FlipLucky opened this issue Aug 21, 2023 · 2 comments

Comments

@FlipLucky
Copy link

What question would you like to ask?

Hello,

My apologies in advance if I missed a ticket that could have answered my question.
I have read up on conditions, and I am looking into all the possibilities of the subject.

I have unfortunately not found a way to create a condition to regulate which child blocks can be picked based on for example a dropdown menu.

I am currently building a pagebuilder with each block being a section on a website.
Based on the dropdown, i can show which fields are present in that block. I have also read ( not tried) that childblocks can also "listen" to the values of the parents fields.

However, i cannot find a way to filter the available child blocks to pick from based on a value from a field from the parent.

Example:
Block A has a dropdown menu with template 1 and 2
Block A has the option to pick from block B, C and D as childblocks

Is it possible to only allow for example block B and C when template 1 is selected, and C and D when template 2 is selected?

Thank you in advance for your time and patience for reading this ticket!

@ttempleton
Copy link
Contributor

This isn't currently possible, and there would be some complications e.g. with child block types for which child blocks already exist becoming invalid. But it'd be a good feature to have if we can figure out the best way to handle cases like that.

@FlipLucky
Copy link
Author

FlipLucky commented Aug 22, 2023 via email

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

2 participants