How to intiatlize Condition Builder in custom plugin #11874
-
I am trying to use the native Craft conditional builder in a Tab Layout in a custom Form plugin. The tab opens in a slideout and I retrieve the condition builder HTML by calling the Tab Layout After rendering the page, I call My best guess at this point is that I'm not initializing HTML properly. If I render the condition builder HTML directly to the page on page load, I can create new conditions and interact with it, but currently, I believe it would be easier if I could render the Tab Settings slideout via an ajax request and initialize the Condition Builder on the fly. I've also tried to re-initialize HTMX after the tab is rendered, but that doesn't seem to do anything.
I've also tried to initialize the individual condition fields
But again, no luck. How can I initialize a conditional builder after an AJAX request so that I can interact with the dropdown and create new conditions? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
You haven't said what you expect to happen. Normally in the condition builder, you have to apply your rules for something to happen. Or are you trying to use it for conditional fields outside of a custom entry type? Either way, your question is so specific to your use-case that it's starting to sound like you may stepping outside of the API that is available for condition builders. |
Beta Was this translation helpful? Give feedback.
-
How are you rendering the field layout designer in the first place? |
Beta Was this translation helpful? Give feedback.
How are you rendering the field layout designer in the first place?