Viewing 3 reply threads
  • Author
    Posts
    • #1265
      Marcus
      Member

      I 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:
      Heirarchical Taxonomy Select List

      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:
      Error within Box

      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

    • #1268
      Kevin
      Keymaster

      Can 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

    • #1272

      Hey Marcus,

      Could you share the code that displays the select field for your Heirarchical Taxonomy Select List?

      Thanks!

    • #1274
      Marcus
      Member

      Sure 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

Viewing 3 reply threads
  • You must be logged in to reply to this topic.