Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].
Hi,
I have another question about repeater construcion and state emitters
'content' => array(
'type' => 'repeater',
'label' => __('Fields of content block', 'oskyr_widget'),
'item_name' => __('Content', 'oskyr_widget'),
'item_label' => array(
'selector' => "[id*='type']",
'update_event' => 'change',
'value_method' => 'val'
),
'fields' => array(
'type' => array(
'type' => 'select',
'label' => 'Type of content',
'state_emitter' => array(
'callback' => 'select',
'args' => array( 'type' )
),
'options' => array(
'headline' => __( 'Headline', 'oskyr_widget' ),
'text' => __( 'Text', 'oskyr_widget' ),
'image' => __( 'Image', 'oskyr_widget' ),
'video' => __( 'Video', 'oskyr_widget' ),
'button' => __( 'Button', 'oskyr_widget' ),
'recipt' => __( 'Recipt', 'oskyr_widget' ),
'icon' => __( 'Icon', 'oskyr_widget' ),
'list_graph' => __( 'Graph list', 'oskyr_widget' ),
'list_guide' => __( 'Guide list', 'oskyr_widget' ),
'icon_group' => __( 'Icon group', 'oskyr_widget' ),
)
),
'headline' => array(
'type' => 'text',
'label' => __( 'Headline text', 'oskyr_widget' ),
'state_handler' => array(
'type[headline]' => array( 'show' ),
'_else[type]' => array( 'hide' ),
),
),
'image' => array(
'type' => 'media',
'label' => __( 'Choose image', 'oskyr_widget' ),
'choose' => __( 'Choose image', 'oskyr_widget' ),
'update' => __( 'Set image', 'oskyr_widget' ),
'library' => 'image',
'state_handler' => array(
'type[image]' => array( 'show' ),
'_else[type]' => array( 'hide' ),
),
),
),
becuase when I change type of one content instance state handler changes all instances of content field. Can I split it somehow?
Hi Łukasz Ziaja
Another bug! :)
Thanks again for letting us know about this. I’ve logged this as a potential bug in our issue tracker. We’ll investigate this as soon as possible and try come up with a fix.
Cheers
Braam
Hi,
I have the same issue. Any update on that ?
Thanks
Hi micemade
This was fixed quite some time ago.
https://siteorigin.com/docs/widgets-bundle/form-building/state-emitters/#heading-states-in-repeaters
Hope that helps.
oh, sorry, didn’t realize that … ( I checked that page, how did I miss that …?)
Thanks Greg :)