- This topic has 2 replies, 2 voices, and was last updated 5 years, 9 months ago by
Steve.
-
AuthorPosts
-
-
May 6, 2016 at 8:00 am #6442
mariusniculaMemberHello,
I’ve created a custom settings page to use just like an Options Page from ACF and it works great, except for the add_more field. See attached images before and after saving.
Thanks for Piklist and your support.
Attachments:
You must be logged in to view attached files. -
May 6, 2016 at 8:01 am #6445
mariusniculaMemberHere is the code for that section:
<?php
/*
Title: Footer Section
Setting: piklist_settings
*/piklist(‘field’, array(
‘type’ => ‘group’,
‘scope’ => ‘post_meta’,
‘field’ => ‘footer_options’,
‘fields’ => array(array(
‘type’ => ‘file’,
‘field’ => ‘option_image’,
‘scope’ => ‘post_meta’,
‘label’ => ‘Option Image’,
‘options’ => array(
‘modal_title’ => ‘Add Image’,
‘button’ => ‘Add’
),
‘validate’ => array(
array(
‘type’ => ‘limit’,
‘options’ => array(
‘min’ => 1,
‘max’ => 1
)
)
),
‘columns’ => 12
),array(
‘type’ => ‘text’,
‘scope’ => ‘post_meta’,
‘field’ => ‘option_link’,
‘label’ => ‘Option Link’,
‘position’ => ‘wrap’,
‘columns’ => 6
),),
‘label’ => ‘Footer Networks’,
‘position’ => ‘wrap’,
‘add_more’ => true,
‘columns’ => 12
));?>
-
May 6, 2016 at 9:07 am #6447
SteveKeymaster@mariusnicula– There are two issues here:
1) You are using the setting
piklist_settings. You probably want to register your own setting.
2) Thescopeis being set topost_meta, which is telling Piklist to save your data to a post… but since this is a settings page, nothing is being saved. So remove all references toscope.
-
-
AuthorPosts
- You must be logged in to reply to this topic.