Tagged: conditions, file, groups
- This topic has 2 replies, 2 voices, and was last updated 7 years, 6 months ago by
Steve.
Viewing 2 reply threads
-
AuthorPosts
-
-
August 8, 2014 at 4:23 pm #2185
JasonKeymasterI was wondering if it’s possible to display a field based on the fact of whether or not a file field has any images selected or not. Unfortunately it didn’t work, but I tried this:
piklist('field', array( 'type' => 'group', 'field' => 'features', 'label' => 'Features', 'add_more'=> true, 'fields' => array( array( 'type' => 'text', 'field' => 'title', 'label' => 'Title', 'columns' => 12 ), array( 'type' => 'textarea', 'field' => 'description', 'label' => 'Description', 'columns' => 12, 'attributes' => array( 'rows' => 4 ) ), array( 'type' => 'file', 'field' => 'image', 'label' => 'Featured Image', 'columns' => 12 ), array( 'type' => 'radio', 'field' => 'image-alignment', 'label' => 'Image Alignment', 'columns' => 12, 'value' => 'bottom', 'list' => false, 'choices' => array( 'align-top' => 'Top', '' => 'Center', 'align-bottom' => 'Bottom' ), 'conditions' => array( array( 'field' => 'features:image', 'compare' => '!=', 'value' => '' ) ) ) ) )); -
August 8, 2014 at 4:25 pm #2186
JasonKeymasterAs a side note, in the documentation in both places you show the compare element, you’re using != as a literal instead of a string. This would cause an error. It should be ‘compare’ => ‘!=’.
-
August 11, 2014 at 10:15 am #2202
-
-
AuthorPosts
Viewing 2 reply threads
- You must be logged in to reply to this topic.