Checklist tree for taxonomy
- This topic has 7 replies, 2 voices, and was last updated 1 year ago by
Yasmine.
-
AuthorPosts
-
November 2, 2023 at 10:35 PM #43722
Yasmine
ParticipantHi 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
November 2, 2023 at 11:59 PM #43723Yasmine
ParticipantOk 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.
November 4, 2023 at 3:33 PM #43737Peter
ModeratorHello Yasmine,
If you want to show the child item when selecting the parent item, please use the field type
select_tree
.November 16, 2023 at 7:16 AM #43818Yasmine
ParticipantHi 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,
YasmineMarch 26, 2024 at 11:16 PM #45019Yasmine
ParticipantHi - 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
March 26, 2024 at 11:37 PM #45021Yasmine
Participantcheckbox_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).
March 28, 2024 at 9:52 PM #45050Peter
ModeratorHello,
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.
April 17, 2024 at 9:26 PM #45240Yasmine
ParticipantThanks Peter - any updates?
-
AuthorPosts
- You must be logged in to reply to this topic.