- This topic has 5 replies, 2 voices, and was last updated 7 years, 7 months ago by
Steve.
-
AuthorPosts
-
-
June 30, 2014 at 5:17 pm #1912
JasonKeymasterGreetings!
I’m working on a plugin and it has a setting page which contains a repeater group field. I’m struggling to get it to look right. The labels don’t show up, the fields are tight together, and the bottom field is jutted out. On a minor note, subsequent repeated groups don’t have the same width for the first text field. Lastly, you’ll notice the default checkbox value is different; I’m not setting it anywhere. Screenshots
piklist('field', array( 'type' => 'group', 'field' => 'taxonomies', 'label' => 'Taxonomies', 'add_more'=> true, 'fields' => array( array( 'type' => 'text', 'field' => 'name', 'label' => 'Name', 'required' => true, 'columns' => 12 ), array( 'type' => 'checkbox', 'field' => 'hierarchical', 'label' => 'Hierarchical', 'required' => true, 'columns' => 12, 'choices' => array( 'true' ) ) ) ));The solution for the labels is to add the columns element with any value. The solution for the jutted field is to set the above field to columns 12.
I may take a stab at fixing this one myself and submitting a patch, but I wanted to report it and make sure it wasn’t already patched. 🙂
Thanks!
-
June 30, 2014 at 6:40 pm #1913
SteveKeymaster@jason– Ok, we have a few things here.
First I would change your code to the following, which moved the label for your second field to the actual value of the choice:
piklist('field', array( 'type' => 'group', 'field' => 'taxonomies', 'label' => 'Taxonomies', 'add_more'=> true, 'fields' => array( array( 'type' => 'text', 'field' => 'name', 'label' => 'Name', 'required' => true, 'columns' => 12 ), array( 'type' => 'checkbox', 'field' => 'hierarchical', 'required' => true, 'columns' => 12, 'choices' => array( 'true' => 'Hierarchical *' ) ) ) ));Second, we have a new version of Piklist coming out that fixes all the alignment errors.
-
July 1, 2014 at 2:00 pm #1918
JasonKeymasterHi Steve!
Good call on the first, and good to know for the second.
I’m not sure if I should make a new thread for this, but it pertains to the context. I added another group field, slug, and gave it the field value “slug”. But, above the group is another field that has the same field value. I assumed that because the second slug was inside of a group it would recognize the difference. I believe it stores properly (that is it wouldn’t write to the same row), but apparently it doesn’t distinguish upon retrieval.
Keep rockin, Piklist!
-
July 1, 2014 at 2:48 pm #1919
JasonKeymasterAnother issue I’m having in the same group: After I add a second instance of the group and save the settings, the checkbox field no longer shows up once the page reloads. Only the checkbox field and only for the non-first fields.
-
July 1, 2014 at 3:07 pm #1920
JasonKeymasterI tried using a radio instead.. no dice. But switching to a Select did the trick.
-
July 1, 2014 at 3:16 pm #1921
-
-
AuthorPosts
- The topic ‘Groups in Settings’ is closed to new replies.