I realize this title may be confusing – but let me explain.
I have a custom widget named “Card” that has a plethora of settings for icons, headings, background images etc… I also have a card group widget which has some specific settings for the group as a whole (such as different templates).
There is a template that should force the use of a background image for all cards in that group if the template select field is set to a particular value.
In my Card Group widget I have something like this (some options removed for brevity):
'tpl' => [ 'type' => 'select', 'default' => 'default', 'options' => [ 'default' => 'Default (Icons)', 'bg-img-with-hover' => 'Background Image w/ Hover', ], 'state_emitter' => [ 'callback' => 'select', 'args' => ['tpl'] ], ],
and in my Card widget I have a handler configured on a field to be conditionally shown/hidden on the emitted state from the field referenced above (some options removed for brevity):
‘icon’ => [
‘state_handler’ => [
‘tpl[default]’ => [‘show’],
‘tpl[bg-img-with-hover]’ => [‘hide’],
This doesn’t seem to work – and I am unsure if it can work the way I would like it to.