- This topic has 6 replies, 3 voices, and was last updated 7 years, 6 months ago by
ralmestro.
-
AuthorPosts
-
-
July 24, 2014 at 7:38 pm #2057
ralmestroMemberHi, first thanks for the incredible job with this project every update is better, But after update to the last version the I can update the meta_box in some pages but in others not, even in some times the fields change the default values.
here is the code:<?php
/*
Title: Hero
Post Type: page
*/
?><?php
piklist(‘field’, array(
‘type’ => ‘select’
,’field’ => ‘add_hero_video_bg’
,’label’ => ‘Backgroud Video’
,’description’ => ‘Check if need a backgroud video’
,’list’ => false
,’choices’ => array(
‘yes’ => ‘Yes’
,’no’ => ‘No’
)
,’value’ => ‘no’
));piklist(‘field’, array(
‘type’ => ‘text’
,’field’ => ‘bg_video_name’
,’label’ => ‘Background Video Name’
,’description’ => ‘Only the name without any extension’
,’conditions’ => array(
array(
‘field’ => ‘add_hero_video_bg’
,’value’ => ‘yes’
)
)
));piklist(‘field’, array(
‘type’ => ‘file’
,’field’ => ‘bg_alt_image’
,’label’ => ‘Background Image’
,’description’ => ‘If no suported video Bg or if video is not added.’
,’options’ => array(
‘title’ => ‘Background Image’
,’button’ => ‘Add image’
)
));piklist(‘field’, array(
‘type’ => ‘select’
,’field’ => ‘plain_gradient_color’
,’label’ => ‘Gradient Overlay?’
,’description’ => ‘Check for select two colors for backgroud overlay’
,’list’ => false
,’choices’ => array(
‘yes’ => ‘Yes’
,’no’ => ‘No’
)
,’value’ => ‘no’
));piklist(‘field’, array(
‘type’ => ‘colorpicker’
,’field’ => ‘overlay_color’
,’label’ => ‘Overlay Color’
,’description’ => ‘Color overlay or background color.’
,’value’ => ‘#2c3e50′
,’attributes’ => array(
‘class’ => ‘text’
)
,’conditions’ => array(
array(
‘field’ => ‘plain_gradient_color’
,’value’ => ‘no’
)
)
,’on_post_status’ => array(
‘value’ => ‘lock’
)
));piklist(‘field’, array(
‘type’ => ‘colorpicker’
,’field’ => ‘gradient_start_color’
,’label’ => ‘Grandient Overlay Start Color’
,’description’ => ‘Color for start gradient (top/left).’
,’value’ => ‘#2c3e50′
,’attributes’ => array(
‘class’ => ‘text’
)
,’conditions’ => array(
array(
‘field’ => ‘plain_gradient_color’
,’value’ => ‘yes’
)
)
,’on_post_status’ => array(
‘value’ => ‘lock’
)
));piklist(‘field’, array(
‘type’ => ‘colorpicker’
,’field’ => ‘gradient_end_color’
,’label’ => ‘Grandient Overlay End Color’
,’description’ => ‘Color for end gradient (bootom/right).’
,’value’ => ‘#808f9e’
,’attributes’ => array(
‘class’ => ‘text’
)
,’conditions’ => array(
array(
‘field’ => ‘plain_gradient_color’
,’value’ => ‘yes’
)
)
,’on_post_status’ => array(
‘value’ => ‘lock’
)
));piklist(‘field’, array(
‘type’ => ‘select’
,’field’ => ‘add_page_logo’
,’label’ => ‘Need Logo?’
,’description’ => ‘Check for insert logo?’
,’list’ => false
,’choices’ => array(
‘yes’ => ‘Yes’
,’no’ => ‘No’
)
,’value’ => ‘no’
));piklist(‘field’, array(
‘type’ => ‘file’
,’field’ => ‘logo_image’
,’label’ => ‘Logo Image’
,’description’ => ‘Add logo as a title’
,’options’ => array(
‘title’ => ‘Logo Image’
,’button’ => ‘Add logo’
)
,’conditions’ => array(
array(
‘field’ => ‘add_page_logo’
,’value’ => ‘yes’
)
)
,’on_post_status’ => array(
‘value’ => ‘lock’
)
));piklist(‘field’, array(
‘type’ => ‘editor’
,’field’ => ‘hero_content’
,’label’ => ‘Extra content for hero’
,’description’ => ‘content to add to the hero’
,’options’ => array(
‘media_buttons’ => false
,’teeny’ => true
,’textarea_rows’ => 5
,’drag_drop_upload’ => true
)
));?>
-
July 24, 2014 at 8:33 pm #2058
KevinKeymasterCan you be a little more specific? Does the problem occur when you update a page created before the update or on a newly created page? I just tried your code and it works perfectly when I create a page and fill it out (by the way, outstanding example of how to use our fields for a meta box!)
Please post steps to reproduce and if needed send an export of the page and meta in question to [email protected] and we will help get things sorted out for you.
Thanks,
Kevin
-
July 24, 2014 at 10:02 pm #2059
ralmestroMemberThanks for the reply so fast, yes the code work ok, but the problem is when you create more than one page, try to create more than two pages, and even try to update the page saved.
Thanks for the compliment, but credit is only by the piklist’s team, with the last updates I want to improve the example including the fields validations and the fields sanitization -
July 25, 2014 at 11:26 am #2063
SteveKeymaster@ralmestro– We were able to reproduce and are working on a fix.
-
July 25, 2014 at 3:35 pm #2066
ralmestroMemberThanks!
-
July 25, 2014 at 3:49 pm #2067
SteveKeymasterPlease upgrade to v0.9.4.1. Thank should fix all issues.
-
July 26, 2014 at 12:01 am #2069
ralmestroMemberThanks a lot, the new update fix the problem.
Have a nice weekend.
-
-
AuthorPosts
- The topic ‘meta_box on pages not saving’ is closed to new replies.