Tagged: 

Viewing 12 reply threads
  • Author
    Posts
    • #3556
      liquidws
      Member

      Hi There.. Great plugin.. love it! Can’t wait to learn more.

      I just started learning and understanding the concepts. This may be a dumb question but i cant seem to find an answer anywhere..

      1)===============================================
      in meta-box.php i defined a field.. example..

      piklist('field', array(
      	'type' 		=> 'text'
      	,'field' 	=> 'member_contact'
      	,'label' 	=> 'Contact'
          ,'attributes' => array( 'placeholder' => 'Contact Name' )
      ));

      on page.php i use

      <?php echo $post->member_contact; ?>

      to display.. No Problem, works fine

      2)===============================================
      But now i do a group..

      piklist('field', array(
          'type' => 'group'
          ,'field' => 'member_phone_group'
          ,'label' => 'Phone'
          ,'list' => false
          // ,'description' => 'A grouped field. Data is not searchable, since it is saved in an array.'
          ,'fields' => array(
      
            array(
              'type' => 'text'
              ,'field' => 'member_phone_areacode'
              ,'columns' => 1
              ,'attributes' => array( 'placeholder' => '956' )
            )
            ,array(
              'type' => 'text'
              ,'field' => 'member_phone_three'
              ,'columns' => 2
              ,'attributes' => array( 'placeholder' => '333' )
            )
            ,array(
              'type' => 'text'
              ,'field' => 'member_phone_four'
              ,'columns' => 3
              ,'attributes' => array( 'placeholder' => '4444' )
            )
      
          )
      ));

      on page.php i use

      <p><strong>Phone:</strong> (<?php echo $post->member_phone_areacode; ?>) <?php echo $post->member_phone_three; ?> - <?php echo $post->member_phone_four; ?></p>

      This does not display at all.. am i doing something wrong? I appreciate any help 🙂

      3)===============================================
      Is there a Help Doc somewhere that explains more frontend display examples?

      Thank you!!

    • #3560
      Steve
      Keymaster

      @liquidws– Welcome to the Piklist community!

      When you create a group field you don’t have to assign the entire group to field (i.e. member_phone_group).

      1) Assigning the group to a field.
      If you assign the entire group to a field like you did, then that field is an array, and all the other fields are part of it:

      Array
      (
          [member_phone_areacode] => Array
              (
                  [0] => 212
              )
      
          [member_phone_three] => Array
              (
                  [0] => 555
              )
      
          [member_phone_four] => Array
              (
                  [0] => 1212
              )
      
      )
      

      2) Not assigning the group to a field.
      You don’t have to assign a group to a field. By removing 'field' => 'member_phone_group', all the other fields will save individually (not part of an array), and they can be accessed normally.

      Does that make sense?

      Your new code would be:

      piklist('field', array(
          'type' => 'group'
          //,'field' => 'member_phone_group'
          ,'label' => 'Phone'
          ,'list' => false
          // ,'description' => 'A grouped field. Data is not searchable, since it is saved in an array.'
          ,'fields' => array(
      
            array(
              'type' => 'text'
              ,'field' => 'member_phone_areacode'
              ,'columns' => 1
              ,'attributes' => array( 'placeholder' => '956' )
            )
            ,array(
              'type' => 'text'
              ,'field' => 'member_phone_three'
              ,'columns' => 2
              ,'attributes' => array( 'placeholder' => '333' )
            )
            ,array(
              'type' => 'text'
              ,'field' => 'member_phone_four'
              ,'columns' => 3
              ,'attributes' => array( 'placeholder' => '4444' )
            )
      
          )
      ));
      
    • #3564
      liquidws
      Member

      Awesome! Thank you so much to the quick reply!

      Love the concept of a Code framework.. I just converted to WordPress a year ago because I was using another cms.. I have was coding raw wp-php code for websites and it was so time consuming with all the repetitive tasks, even when experimenting with other plugins and frameworks.

      But with Piklist I save so much time. You guys rock! this code framework is awesome.

      Quick question.. Is there a way to limit the user to a specific number of characters? Couldn’t find this in the demo either. For example.. limit the Area Code input box to only three characters.

      Please take you time in answering this 🙂

    • #3567
      Steve
      Keymaster

      @liquidws– I just emailed you the latest beta 0.9.5u which allows for this. It extends the limit validation rule.

      Add this to your field configuration:

          ,'validate' => array(
            array(
              'type' => 'limit'
              ,'options' => array(
                'min' => 3
                ,'max' => 3
                ,'count' => 'characters'
              )
            )
          )
      

      We definitely appreciate the kind words, but we already Piklist is awesome. 😉

      If you could let the world know by leaving a 5 star review on WordPress.org it would really help promote the project.

    • #3572
      liquidws
      Member

      Absolutely! Done.. 5 stars!

      @Steve – Thank you so much! If there is anything I can do to help you, please email/skype me and let me know.

      FYI.. got the plugin, tired it out. Awesome.. just one problem, I’m testing out another plugin.. Simple Directory Plugin.. which is dependant on Piklist.. seems to not be compatible at this time with the beta. I will see what other options i have 🙂

      Again, awesome.

    • #3573
      Steve
      Keymaster

      @liquidws– We really appreciate the review. Thanks so much!

      As for Simple Directory Plugin, we pulled a function out of the beta, but it looks like some plugins are using it.

      Add this to the bottom of class-piklist-admin.php, BEFORE the final closing bracket.

        public static function responsive_admin()
        {
          if (version_compare($GLOBALS['wp_version'], '3.8', '>=' ))
          {
            return true;
          }
          else
          {
            return false;
          }
        }
      

      That should fix the Simple Directory Plugin.

    • #3574
      liquidws
      Member

      Weird.. this code was already there. I will keep testing and see what happens.

    • #3575
      liquidws
      Member

      yeah.. kills frontend

      Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'simple_dir_load_template' not found or invalid function name in /home/laredobuilders/public_html/dev/wp-includes/plugin.php on line 213

    • #3576
      Steve
      Keymaster

      @liquidws– What version of Piklist are you running?

    • #3580
      liquidws
      Member

      piklist.beta.0.9.5u

    • #3581
      Steve
      Keymaster

      There is an error in the Simple Directory plugin.

      In simple-directory.php, find this line:
      add_filter( 'template_include', 'simple_dir_load_template' );

      and change it to:
      add_filter( 'template_include', 'simple_dir_load_templates' );

      The function name should now be plural.

      I’ll let the plugin author know.

    • #3583
      liquidws
      Member

      Very cool!

      I just saw a plugin update on Simple Directory and noticed this bug fix is resolved. That was quick! very cool!

    • #3584
      Steve
      Keymaster

      We worked with the developer to fix. Thanks for letting us know. Closing ticket.

Viewing 12 reply threads
  • The topic ‘Display Group Fields on Frontend Template’ is closed to new replies.