Tagged: ,

Viewing 6 reply threads
  • Author
    Posts
    • #2057
      ralmestro
      Member

      Hi, 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
      )
      ));

      ?>

    • #2058
      Kevin
      Keymaster

      @ralmestro

      Can 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

    • #2059
      ralmestro
      Member

      Thanks 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

    • #2063
      Steve
      Keymaster

      @ralmestro– We were able to reproduce and are working on a fix.

    • #2066
      ralmestro
      Member

      Thanks!

    • #2067
      Steve
      Keymaster

      Please upgrade to v0.9.4.1. Thank should fix all issues.

    • #2069
      ralmestro
      Member

      Thanks a lot, the new update fix the problem.
      Have a nice weekend.

Viewing 6 reply threads
  • The topic ‘meta_box on pages not saving’ is closed to new replies.