You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
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.
Thank you for your quick reply.
I hope these findings could help you with the research/development of the
possibilities with this feature:
- I use the preview a lot for testing, since users will be doing the same.
The rule of conditional Fields is that they do not show when the condition
is not fulfilled. However, when a value was stored, it kept the value, even
though it was no longer shown. I had to build checks in my twig templates
to prevent this from happening.
I have looked at alternative solutions, like the conditional Fields in
child locks based on their parents. I hoped I could make several different
tabs in 1 child block, each representing a different template.
Unfortunately, craft does not allow duplicate fields to exist in the same
block( for obvious reasons, since craft cannot rule out the possibilities
of conflicting values on the same field type within a block.
Thank you again for looking into this matter, and the time you have already
took to look into this ticket!
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!
The text was updated successfully, but these errors were encountered: