Tagged: add_more, conditionals, nested
- This topic has 16 replies, 5 voices, and was last updated 4 years, 9 months ago by
Jason.
-
AuthorPosts
-
-
July 9, 2015 at 6:24 am #3982
skytsunamiMemberHi Guys,
I am having a problem/bug with some nested repeater group fields that have conditionals.
The space for the add_more group always shows even if the conditional is not met, take a look at the images bellow.Here is the code, am I doing something wrong?
piklist('field', array( 'type' => 'group' ,'field' => 'cs_select_module_group' ,'label' => __('Your Page Modules') ,'add_more' => true ,'fields' => array( /* This will show the initial selection of modules */ array( 'type' => 'select' ,'field' => 'cs_module_select' ,'label' => 'Select a Module' ,'columns' => 12 ,'choices' => array( 'none' => 'Select a Module to add' ,'module' => 'Simple Module' ,'big_module' => 'Big Module' ,'stats_module' => 'Stats Module' ,'logos_module' => 'Logos Module' ,'grid_module' => 'Grid Module' ) ) /* Conditional for Simple Module */ ,array( 'type' => 'select' ,'field' => 'cs_module_backcolor' ,'label' => 'Module back color:' ,'columns' => 6 ,'choices' => array( 'white' => 'White' ,'blue' => 'Blue' ,'black' => 'Black' ,'gray' => 'Gray' ) ,'conditions' => array( array( 'field' => 'cs_select_module_group:cs_module_select' ,'value' => 'module' )) ) ,array( 'type' => 'select' ,'field' => 'cs_module_textcolor' ,'label' => 'Module main text color:' ,'columns' => 6 ,'choices' => array( 'white' => 'White' ,'blue' => 'Blue' ,'black' => 'Black' ) ,'conditions' => array( array( 'field' => 'cs_select_module_group:cs_module_select' ,'value' => 'module' )) ) ,array( 'type' => 'editor' ,'field' => 'cs_module_text' ,'label' => 'Module text' ,'columns' => 12 ,'options' => array ( 'wpautop' => true ,'media_buttons' => false ,'tabindex' => '' ,'editor_css' => '' ,'editor_class' => true ,'teeny' => false ,'dfw' => false ,'tinymce' => true ,'quicktags' => true ) ,'conditions' => array( array( 'field' => 'cs_select_module_group:cs_module_select' ,'value' => 'module' )) ) /* Conditional for Big Module */ ,array( 'type' => 'select' ,'field' => 'cs_bigmodule_backcolor' ,'label' => 'Module back color:' ,'columns' => 6 ,'choices' => array( 'white' => 'White' ,'blue' => 'Blue' ,'black' => 'Black' ,'gray' => 'Gray' ) ,'conditions' => array( array( 'field' => 'cs_select_module_group:cs_module_select' ,'value' => 'big_module' )) ) ,array( 'type' => 'select' ,'field' => 'cs_bigmodule_textcolor' ,'label' => 'Module main text color:' ,'columns' => 6 ,'choices' => array( 'white' => 'White' ,'blue' => 'Blue' ,'black' => 'Black' ) ,'conditions' => array( array( 'field' => 'cs_select_module_group:cs_module_select' ,'value' => 'big_module' )) ) ,array( 'type' => 'select' ,'field' => 'cs_bigmodule_textalign' ,'label' => 'Text Alignment:' ,'columns' => 12 ,'choices' => array( 'right' => 'Right' ,'left' => 'Left' ) ,'conditions' => array( array( 'field' => 'cs_select_module_group:cs_module_select' ,'value' => 'big_module' )) ) ,array( 'type' => 'editor' ,'field' => 'cs_bigmodule_textarea' ,'label' => 'Big Module text:' ,'columns' => 12 ,'options' => array ( 'wpautop' => true ,'media_buttons' => false ,'tabindex' => '' ,'editor_css' => '' ,'editor_class' => true ,'teeny' => false ,'dfw' => false ,'tinymce' => true ,'quicktags' => true ) ,'conditions' => array( array( 'field' => 'cs_select_module_group:cs_module_select' ,'value' => 'big_module' )) ) ,array( 'type' => 'file' ,'field' => 'cs_bigmodule_img' ,'scope' => 'post_meta' ,'label' => __('Select an Image (max 1)','piklist') ,'columns' => 12 ,'options' => array( 'modal_title' => __('Add Image(s)','piklist') ,'button' => __('Add','piklist') ) ,'validate' => array(array( 'type' => 'limit' ,'options' => array('max' => 1) )) ,'conditions' => array( array( 'field' => 'cs_select_module_group:cs_module_select' ,'value' => 'big_module' )) ) /* Conditional for Stats Module */ ,array( 'type' => 'select' ,'field' => 'cs_statsmodule_backcolor' ,'label' => 'Module back color:' ,'columns' => 6 ,'choices' => array( 'white' => 'White' ,'blue' => 'Blue' ,'black' => 'Black' ,'gray' => 'Gray' ) ,'conditions' => array( array( 'field' => 'cs_select_module_group:cs_module_select' ,'value' => 'stats_module' )) ) ,array( 'type' => 'select' ,'field' => 'cs_statsmodule_textcolor' ,'label' => 'Module main text color:' ,'columns' => 6 ,'choices' => array( 'white' => 'White' ,'blue' => 'Blue' ,'black' => 'Black' ) ,'conditions' => array( array( 'field' => 'cs_select_module_group:cs_module_select' ,'value' => 'stats_module' )) ) ,array( 'type' => 'textarea' ,'field' => 'cs_statsmodule_title' ,'label' => 'Stats Module title:' ,'columns' => 12 ,'add_more' => true ,'attributes' => array('class' => 'large-text', 'rows' => 2) ,'validate' => array(array( 'type' => 'limit' ,'options' => array('min' => 4,'max' => 4) )) ,'conditions' => array( array( 'field' => 'cs_select_module_group:cs_module_select' ,'value' => 'stats_module' )) ) ,array( 'type' => 'textarea' ,'field' => 'cs_statsmodule_text' ,'label' => 'Stats Module text:' ,'columns' => 12 ,'add_more' => true ,'attributes' => array('class' => 'large-text', 'rows' => 3) ,'validate' => array(array( 'type' => 'limit' ,'options' => array('min' => 4,'max' => 4) )) ,'conditions' => array( array( 'field' => 'cs_select_module_group:cs_module_select' ,'value' => 'stats_module' )) ) ) /* End of fields array */ ));Attachments:
You must be logged in to view attached files. -
July 9, 2015 at 6:42 am #3985
skytsunamiMemberLooks Like this happens when you set add_more to true on any field that has a conditional set to it.
Any help would be greatly appreciated.
Thanks in advance -
July 9, 2015 at 1:37 pm #3987
SteveKeymaster@skytsunami– Welcome to the Piklist community!
Unfortunately, I don’t have a great answer for you right now. You found a new bug, and it will probably take some time to fix.
You could try breaking out the fields, so you don’t have one giant
groupfield… that may help. In the Piklist Demos, under the Conditions tab, check out the Party Invite meta box. It uses similar conditions, but not in agroupfield.-
July 10, 2015 at 4:37 am #3989
skytsunamiMemberI am doing this way as i am using piklist to create a “Page Builder” where you have a dropdown button with the different blocks available that you can repeat as many times as necessary and that you can then rearrange the order. What is bugging out is when you add another add_more inside of it…
If there is any other workaround this would be appreciated.
Thanks in advance
-
July 10, 2015 at 9:38 am #3990
SteveKeymasterDid you try breaking those fields out of the group field? Like the Party Invite demo.
-
July 10, 2015 at 9:53 am #3991
skytsunamiMemberHi Steve, yes I did but then it does not work the way I want.
So to resume i want to be able to create a repeater field that I can reorder with its conditional fields if I separate them i will not be able to reorder them. So I am using this logic to create a custom post type page builder where I can add predefined Modules and this way build my page from the admin side of WordPress.
Wanted to use PikList because not only its awesome its also faster to develop… Hope this gets fixed soon
Thanks
-
-
July 10, 2015 at 10:07 am #3992
SteveKeymasterAnother solution might be Piklist Workflow tabs. Instead of a dropdown with conditions, Your tabs can be: Simple Module, Big Module, Stats Module, Logos Module and Grid Module.
Once the user clicks on a tab you can present them with a very customized interface. Even more than conditional fields.
Check out the Piklist Demos to see how we do it, or read this doc.
So happy you love Piklist! Would you mind telling the world by leaving Piklist a 5 Star review on WordPress.org?
-
July 10, 2015 at 10:35 am #3993
skytsunamiMemberI had looked into Workflows before posting this topic, it also works great but does not allow me to re-arrange the position of the modules or add more modules.
About the review I sure will post a review.
-
July 10, 2015 at 10:46 am #3994
SteveKeymasterWhat do you mean “re-arrange the position of the modules or add more modules”?
-
July 10, 2015 at 11:38 am #3996
skytsunamiMemberI want to be able to add multiple modules on a non specific order, that is why the fields where inside one big group that could be repeated. So you could add multiple “Modules” and because was a add more field you could drag and drop in any order you needed the modules to be, the conditional inside the big group where the fields for each “Module” type that would show and hide depending on the selected option from the dropdown menu.
To make things more fun some of these “Modules” also need to have repeater fields nested.
At the moment I am using ACF to archive this configuration.
-
-
July 10, 2015 at 11:41 am #3997
SteveKeymasterGot it…
We definitely want Piklist to do this. It just may be a while.
-
July 10, 2015 at 1:03 pm #3999
skytsunamiMemberHope that piklist gets to this level soon, in reality this can be archived as soon as the bug is fixed hopefully in the next release?!? If you need anyone to beta test this let me know as this would be a function that i would use a lot soon its implemented.
Thanks Steve
-
July 22, 2015 at 11:55 am #4050
skytsunamiMemberHi Steve,
Do we have any timeline to when should this bug be fixed? I would love to keep using piklist fall all projects and start to use it for more advanced things.
Thanks
-
July 23, 2015 at 4:46 pm #4057
SteveKeymaster@skytsunami– We are trying to get the next version ready for testing. It may be a few weeks before we can get to this bug.
I added you to our beta tester list, so you will receive the latest version when it’s ready for testing.
-
January 21, 2017 at 8:14 pm #7741
alexdParticipanthey @skytsunami did you manage to make this work in piklist or did you have to stay on with ACF?
-
April 5, 2017 at 7:55 pm #7911
friendlyfire3MemberHaving this same issue. Need nested fields as I also need the rearrange (drag n drop order) option. However, I also need the show/hide functionality but it’s not working on 0.9.9.12.
-
May 2, 2017 at 12:55 pm #8060
JasonKeymaster@friendlyfire3 Has this been tested with the latest 0.10 Beta?
-
-
AuthorPosts
- You must be logged in to reply to this topic.