Tagged: add_more
- This topic has 3 replies, 2 voices, and was last updated 9 years, 2 months ago by
Steve.
-
AuthorPosts
-
-
November 27, 2012 at 11:18 am #455
jchambMemberI’m experimenting with piklist, and have come across a case where I need an add more inside of an add more. To give more detail I’ll explain the scenario.
I have a field type of group for “activities” this activities group will contain two fields… the first is the “Activities Group Name” which will be used to separate the activities by age group (basically a title for each list of activities) the second field is the actual “activities” field. This is just a text input that needs to also be repeatable.
This way they would be able to create multiple groups, that all contain their own list of activities. (as a side note this would be for a post type of camps, in which each camp has its own set of activities)
Right now I have this setup in my metabox file.
piklist(‘field’, array(
‘type’ => ‘group’
,’field’ => ‘activities’
,’label’ => ‘Activities’
,’add_more’ => true
,’description’ => ”
,’fields’ => array(
array(
‘type’ => ‘text’
,’field’ => ‘activity_group’
,’label’ => ‘Activity Group’
,’label_position’ => ‘before’
,’columns’ => 11
)
,array(
‘type’ => ‘text’
,’field’ => ‘activities’
,’label’ => ‘Activity’
,’label_position’ => ‘inline’
,’add_more’ => true
,’columns’ => 6
)
)
));When you edit a post, i can add multiple activities, but i can’t add another group. Any thoughts for work arounds, or a better way to handle the scenario.
Thanks
-
November 27, 2012 at 5:07 pm #456
SteveKeymaster@jchamb– Thanks for trying out Piklist!
Unfortunately, Piklist does not support an Add-More within an Add-More. This is an awesome idea, and we’ll put in on our list of todo’s… but it will be a while before we can work on it.
A workaround (not as nice), is to list out X number of Activity Groups, and then in your theme only display the ones that are not empty.
-
November 28, 2012 at 3:29 pm #479
jchambMember@Steve – Thanks, and yes it would be a great feature. As i’ve been experimenting with frameworks, I know Pods 2 is also working on some similar functionality for “multiple looping”.
As a work around I ended up just using a textarea and with my description asked each activity to be separated by a comma so i can just split the string into an array… still not as nice but it will do.
Thanks again. Keep up the great work. I’m really loving Piklist so far!
-
November 29, 2012 at 9:38 am #482
-
-
AuthorPosts
- You must be logged in to reply to this topic.