- This topic has 3 replies, 3 voices, and was last updated 8 years, 1 month ago by
Marcus.
-
AuthorPosts
-
-
December 18, 2013 at 11:55 am #1265
MarcusMemberI needed a hierarchical taxonomy select list, so I built my own, (thanks to the incredible flexibility of piklist)
However, I am in dire need of some help.You can see the field working here:
The problem I’m having and I’m hoping Kevin can help, is when I save my selections.
It saves exactly how I want, as an Array.
Just like the checkbox field does.The problem I’m having is that unlike the checkbox field, if I select more than one field, it creates TWO select boxes, and duplicates it. Here’s my example:
Having walked through the piklist code many times, I’m assuming its doing this, because it is not passing an ARRAY of values to the new field I created. Checkbox is sent an array of values, and only called once per checkbox group.
Mine is called on every value, even though it is pulling from an array of values, so the $value field in my new box, is always just a single value, never an array.Could you guys please help. What code would you need me to post, to give you a better idea of where I’m going wrong.
Thanks
Marcus
-
December 20, 2013 at 9:38 pm #1268
KevinKeymasterCan you email the code? I think this is a configuration issue but I need to review the code used to render the field to be sure 😉
Thanks
Kevin
-
December 25, 2013 at 11:00 pm #1272
johnmcalesterMemberHey Marcus,
Could you share the code that displays the select field for your Heirarchical Taxonomy Select List?
Thanks!
-
December 26, 2013 at 9:04 am #1274
MarcusMemberSure thing.
Just please remember this is buggy and was my first attempt at creating a new field.
But you’re welcome to play with it.
The code for the piklist field is:
piklist('field', array( 'type' => 'taxonomy-all' ,'scope' => 'taxonomy' ,'label' => 'Choose Camp Categories' ,'field' => 'mae_merch_sett_cats' ,'template' => 'field' ,'catname' => 'campcats' ,'add_more' => true ));The field file, which needs to put in piklist/parts/fields/ folder is:
https://gist.github.com/anonymous/8133544
And the walker class that builds the checkbox list and is just an include in your field file is at:
https://gist.github.com/anonymous/8133566
If you have any luck getting it fixed please post.
Thanks
Marcus
-
-
AuthorPosts
- You must be logged in to reply to this topic.