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
maybe I did not understand the examples, but I can not condition (show / hide) an entire group of fields, directly from the creation from the main field of the group.
Instead it works if I apply the code to every single field in the group.
The conditional field is outside the group.
Code:
DOES NOT WORK $cmb_cr_frontpage_image_id = $cmb_cr_frontpage_image->add_field( array( 'id' => PREFIXCMB2 . 'frontpage_image_group', 'type' => 'group', 'name' => __( 'Elenco immagini', 'genesis-theme-cr' ), 'description' => __( 'Di seguito puoi inserire e ordinare le immagini. <strong>DIMENSIONE CONSIGLIATA: 1000x668px.</strong><br /><br />Nota: - È il contenuto testuale sopra all\'immagine che determina l\'altezza dell\'immagine. <br />Non deve essere corto per permettere la corretta sovrapposizione del colore. <br />Mantenere la lunghezza del contenuto e delle immagini più uniformi possibili, <strong>MEGLIO SE UGUALI</strong>.', 'genesis-theme-cr' ), 'options' => array( 'group_title' => __( 'Immagine {#}', 'genesis-theme-cr' ), 'add_button' => __( 'Aggiungi immagine', 'genesis-theme-cr' ), 'remove_button' => __( 'Rimuovi immagine', 'genesis-theme-cr' ), 'sortable' => true, // beta 'closed' => true, // true to have the groups closed by default ), 'data-conditional-id' => PREFIXCMB2 . 'frontpage_image_fonte', 'data-conditional-value' => 'libere', ), ) );
This is an automatic translation
Hello,
maybe I did not understand the examples, but I can not condition (show / hide) an entire group of fields, directly from the creation from the main field of the group.
Instead it works if I apply the code to every single field in the group.
The conditional field is outside the group.
Code:
DOES NOT WORK
$cmb_cr_frontpage_image_id = $cmb_cr_frontpage_image->add_field( array( 'id' => PREFIXCMB2 . 'frontpage_image_group', 'type' => 'group', 'name' => __( 'Elenco immagini', 'genesis-theme-cr' ), 'description' => __( 'Di seguito puoi inserire e ordinare le immagini. <strong>DIMENSIONE CONSIGLIATA: 1000x668px.</strong><br /><br />Nota: - È il contenuto testuale sopra all\'immagine che determina l\'altezza dell\'immagine. <br />Non deve essere corto per permettere la corretta sovrapposizione del colore. <br />Mantenere la lunghezza del contenuto e delle immagini più uniformi possibili, <strong>MEGLIO SE UGUALI</strong>.', 'genesis-theme-cr' ), 'options' => array( 'group_title' => __( 'Immagine {#}', 'genesis-theme-cr' ), 'add_button' => __( 'Aggiungi immagine', 'genesis-theme-cr' ), 'remove_button' => __( 'Rimuovi immagine', 'genesis-theme-cr' ), 'sortable' => true, // beta 'closed' => true, // true to have the groups closed by default ), 'data-conditional-id' => PREFIXCMB2 . 'frontpage_image_fonte', 'data-conditional-value' => 'libere', ), ) );
IT WORKS
$cmb_cr_frontpage_image->add_group_field( $cmb_cr_frontpage_image_id, array( 'name' => __( 'Immagine', 'genesis-theme-cr' ), 'desc' => __( '', 'genesis-theme-cr' ), 'id' => PREFIXCMB2 . 'frontpage_image_group_image', 'type' => 'file', 'attributes' => array( 'data-conditional-id' => PREFIXCMB2 . 'frontpage_image_fonte', 'data-conditional-value' => 'libere', ), ) );
I apologize if I have not explained well.
Thanks, Claudio
The text was updated successfully, but these errors were encountered: