Support Forum
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
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.
Hello Yasmine,
If you want to show the child item when selecting the parent item, please use the field type select_tree
.
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
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
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).
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.
Thanks Peter - any updates?