- This topic has 3 replies, 2 voices, and was last updated 2 years, 6 months ago by
Steve.
-
AuthorPosts
-
-
July 19, 2019 at 9:41 am #9455
dahnsnakeParticipantHi, First of all I love Piklist <3! This is the first time I could not figure something out on my onw. I made created this code with the last array a group with add more (or repeater) functionality. I would like to know how I can loop through the group ‘writer’. So the loop creates a new div with the new data when the add more functionality is used. This way I would like the user to be able to add more writers to a book :). I saw this one but I could not figure it out: https://piklist.com/support/topic/repeater-field/
`piklist(‘field’, array(
‘type’ => ‘group’
,’label’ => __(‘Blok boek en schrijvers’)
,’description’ => __(‘Het tweede blok met het boek “hou je kop erbij” en de schrijvers eronder.’)
,’fields’ => array(
array(
‘type’ => ‘text’
,’field’ => ‘home-book-title’
,’label’ => __(‘Titel’)
,’columns’ => 4
,’attributes’ => array(
‘placeholder’ => ‘Titel’
)
)
,array(
‘type’ => ‘text’
,’field’ => ‘home-book-button’
,’label’ => __(‘Link onder tekst’)
,’columns’ => 4
,’attributes’ => array(
‘placeholder’ => ‘Knop’
)
)
,array(
‘type’ => ‘text’
,’field’ => ‘home-book-button2′
,’label’ => __(‘Knop onder schrijvers’)
,’columns’ => 4
,’attributes’ => array(
‘placeholder’ => ‘Knop’
)
)
,array(
‘type’ => ‘editor’
,’field’ => ‘home-book-introduction’
,’label’ => __(‘Introductie bij het boek’)
,’columns’ => 12
,’attributes’ => array(
‘placeholder’ => ‘Introductie’
)
)
,array(
‘type’ => ‘group’
,’field’ => ‘writer’
,’label’ => __(‘Schrijver’)
,’add_more’ => true
,’fields’ => array(
array(
‘type’ => ‘text’
,’field’ => ‘writerName’
,’label’ => __(‘Naam’)
,’columns’ => 4
,’attributes’ => array(
‘placeholder’ => ‘Naam’
)
)
,array(
‘type’ => ‘text’
,’field’ => ‘writer-linkedin’
,’label’ => __(‘LinkedIn’)
,’columns’ => 4
,’attributes’ => array(
‘placeholder’ => ‘LinkedIn’
)
)
)
)
)
)); -
July 22, 2019 at 4:07 am #9457
dahnsnakeParticipantAnyone :D?
-
July 23, 2019 at 1:44 pm #9461
SteveKeymasterThere is a bug with this type of field that should be addressed in the next major release of Piklist.
For the time being, I suggest you remove
,’field’ => ‘writer’. Piklist will keep the values ofwriterNameandwriter-linkedinin order, so you can pull each usingget_post_metaand sync the keys.Let me know if you still have questions.
-
July 23, 2019 at 1:44 pm #9462
SteveKeymasterThere is a bug with this type of field that should be addressed in the next major release of Piklist.
For the time being, I suggest you remove
,’field’ => ‘writer’. Piklist will keep the values ofwriterNameandwriter-linkedinin order, so you can pull each usingget_post_metaand sync the keys.Let me know if you still have questions.
-
-
AuthorPosts
- You must be logged in to reply to this topic.