acf-builder
acf-builder copied to clipboard
Feature Request: more flexible condition builder
I've been playing around with Stout and one thing I've noticed is that the condition builder only supports specific field types:
... but only based on a field that has choices: checkbox, radio, select, true_false.
(From the wiki)
In ACF its not uncommon to add in conditional logic based on whether or not a a field is set. I believe I've replicated this in Stout using the following:
<?php
...
->addSelect('sub-heading_color', [
'conditional_logic' => [
[
[
'field' => 'sub-heading',
'operator' => '!=empty'
]
]
],
...
And visually in the admin system that does what I'm expecting, when the other field sub-heading has an empty value input the sub-heading_color field is not displayed.
Can conditions be adapted to support such behaviour? For example:
<?php
...
->addSelect('sub-heading_color')
->conditional('sub-heading', '!=empty')
...