Home › Forums › General Issues › SELECT2JS
Hi,
I would like that my ACF taxonomy list looks like the defautl library https://select2.org/selections.
In my case, a hierarchy list, i need to have BOLD on first level and more indentation on 2nd level.
I don’t understand why ACF does not keep the SELECT2JS default presets that are much better visually.
ACF adds ‘ – ‘ for 2nd level and nogt BOLD on first.
Thanks for help.
Not sure I understand what you’re looking for help with. If you are suggesting that ACF changes this you can submit a support ticket here https://www.advancedcustomfields.com/contact/
If you want to alter the way the text is shown in the select field ACF has a filter to let you do that https://www.advancedcustomfields.com/resources/acf-fields-taxonomy-result/
Yes maybe ACF could change the look of taxonomy field.
But yes also, in my case, maybe can i use the filter you tell me, can i insert html tags into ?
I wish:
FIRSTLEVEL
<padding 20px> 2nd level
<padding 20px> 2nd level
<padding 20px> 2nd level
Honestly, I don’t know. I have never used this filter. But as I understand it Select2 is supposed to be able to handle html in select labels. You’d have to test it to find out.
what is strange is that when i use the filter as written in demo only to test, my list is empty (there are line items but no text…
function my_post_object_result( $title, $term, $field, $post_id ) {
// add the term's slug to each result
$title .= '(' . $term->slug . ')';
return $title;
}
add_filter('acf/fields/taxonomy/result', 'my_taxonomy_result', 10, 4);
Well, it’s doing something. But I haven’t got a clue why your getting no label listed at all.
very strange because same number of items (line items) but white with no text…
Hi @pipoulito
did you found any solution for this? I’m also looking for this as 3-4 level child parent and I want to disable 2-3 level parent from selecting.
The topic ‘SELECT2JS’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.