Tagged: groups
- This topic has 12 replies, 2 voices, and was last updated 6 years, 10 months ago by
Steve.
-
AuthorPosts
-
-
April 2, 2015 at 1:05 am #3556
liquidwsMemberHi 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!!
-
April 2, 2015 at 10:24 am #3560
SteveKeymaster@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' ) ) ) )); -
April 2, 2015 at 12:40 pm #3564
liquidwsMemberAwesome! 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 🙂
-
April 2, 2015 at 3:31 pm #3567
SteveKeymaster@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.
-
April 2, 2015 at 10:31 pm #3572
liquidwsMemberAbsolutely! 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.
-
April 2, 2015 at 11:10 pm #3573
SteveKeymaster@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.
-
April 3, 2015 at 1:03 am #3574
liquidwsMemberWeird.. this code was already there. I will keep testing and see what happens.
-
April 3, 2015 at 1:03 am #3575
liquidwsMemberyeah.. 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 -
April 3, 2015 at 8:21 am #3576
-
April 4, 2015 at 6:20 pm #3580
liquidwsMemberpiklist.beta.0.9.5u
-
April 4, 2015 at 8:01 pm #3581
SteveKeymasterThere 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.
-
April 7, 2015 at 10:52 pm #3583
liquidwsMemberVery cool!
I just saw a plugin update on Simple Directory and noticed this bug fix is resolved. That was quick! very cool!
-
April 7, 2015 at 11:04 pm #3584
SteveKeymasterWe worked with the developer to fix. Thanks for letting us know. Closing ticket.
-
-
AuthorPosts
- The topic ‘Display Group Fields on Frontend Template’ is closed to new replies.