Checklist tree for taxonomy

Support General Checklist tree for taxonomy

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #43722
    YasmineYasmine
    Participant

    Hi Peter,

    Where am I going wrong? 1. My checklist tree does not group into the parent. See image: https://jam.dev/c/e72f213f-db30-41bb-83b2-6dad1ef09b65

             [
                    'name'          => __( 'Country focus', 'your-text-domain' ),
                    'id'            => $prefix . 'academiccountry_focus',
                    'type'          => 'taxonomy',
                    'taxonomy'      => ['country-tags'],
                    'placeholder'   => __( 'Type or select an option..', 'your-text-domain' ),
                    'field_type'    => 'checkbox_tree',
                    'flatten'     => true, //have also tried false
                    'multiple'      => true,
                    'parent' => 10151, 
                    'query_args'    => [
                        'orderby' => 'menu_order',
                        'order'   => 'ASC',
                    ],
                    'admin_columns' => [
                        'position'   => 'after title',
                        'title'      => 'Country',
                        'sort'       => true,
                        'searchable' => true,
                        'filterable' => true,
                    ],
                    'columns'       => 12,
                    'class' => 'rs_p5',
                    'tab'           => 'page_5',
                ],

    2. As a second question for when I get this working, how can I hide a level of the parent? I do not want "global" to be an option and want to start with region at second level

    #43723
    YasmineYasmine
    Participant

    Ok question number 2 you can ignore -query_args!

    But still stuck on number one, especially as I read they are only supposed to show the parent until clicked, exactly what I want.

    #43737
    PeterPeter
    Moderator

    Hello Yasmine,

    If you want to show the child item when selecting the parent item, please use the field type select_tree.

    #43818
    YasmineYasmine
    Participant

    Hi Peter,

    Thanks for the suggestion. But I would like the parents listed and when selected the children to show. Select_tree gives you two input boxes, and does not list, and this is not what I want.

    In the documentation for both select / checkbox tree it says "When users select a parent item, it will show children item." - this is what I want but it is not happening.

    I saw in other help threads that others were using checkbox tree and none of the children were showing. It was discussed that there could be an option to choose between showing / hiding children terms. I want the children terms hidden, but could it be that you made a change because of these discussions and changed it around?

    Thanks,
    Yasmine

    #45019
    YasmineYasmine
    Participant

    Hi - this was never fixed. My checkbox tree with code:

               [
                    'name'          => __( 'Country focus', 'your-text-domain' ),
                    'id'            => $prefix . 'academiccountry_focus',
                    'type'          => 'taxonomy',
                    'taxonomy'      => ['country-tags'],
                    'field_type'    => 'checkbox_tree',
                    'multiple'      => true,
                    'flatten' => false,
                    'query_args'    => [
                        'orderby' => 'menu_order',
                        'order'   => 'ASC',
                        'child_of' => 10152,
                    ],
    

    Shows all the values. Not just the first parent. I want only the parent values to show, and when they are clicked then for its children to show

    #45021
    YasmineYasmine
    Participant

    checkbox_tree Hierarchical list of checkboxes which allows to select multiple items (select/deselect parent item will show/hide child items). Applied only when the taxonomy is hierarchical (like category).

    #45050
    PeterPeter
    Moderator

    Hello,

    I've escalated this issue to the development team to check the issue with the checkbox tree field. I will get back to you later.

    #45240
    YasmineYasmine
    Participant

    Thanks Peter - any updates?

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.