Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › ACF Author field
This topic contains 4 replies, has 2 voices, and was last updated by echse 4 years, 12 months ago.
- AuthorPosts
- June 11, 2018 at 6:40 pm #18206
Hi,
Im using ACF to display meta data of publications. Every publication has several authors. So i have one textfield where i write down all the authors like author1, author2, author3.
So im using the search filter as a filter application for all the publications and its needed to filter the authors (with a checkbox). But now when i use a ACF in the filter i get checkboxes like
[ ] author1, author2, author3
[ ] author3, author4If i use several ACF fields for several authors i have the problem, that there are some names displayed multiple times.
Is it possible to cut the names in one ACF field and display them only once in my filter?
I need it like
[ ] author1
[ ] author2
[ ] author3Thank you very much.
Kind regards
TimJune 12, 2018 at 9:52 am #18221Hi Tim,
I am assuming you are using the {get_values} syntax within the filter to automatically get the checkbox values.
The problem here is, that there are no pre-defined values within the ACF field group, you simply enter the values as-is into a text field. If you were to use an ACF checkbox, then the plugin would be able to parse the individual values only, as those values are stored before using them.
I think there are two possible ways to resolve this:
1. To use a static checkbox ACF field instead of the text field
Best,
2. ..or simply enter the author names manually to the filter, instead of using the {get_field} syntax
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 12, 2018 at 1:38 pm #18228Thank you for the fast reply.
Yes im using the {get_values} syntax. The reason is, that our customer just wants to fill the ACF fields when he creates a new publication.
So did i get it right, that there is no “automated” way to create the filter checkboxes out of the customers input?Thanks a lot!
Kind regards
TimJune 12, 2018 at 4:33 pm #18235Hi Tim,
In this case, unfortunately I don’t think there is. It is basically automated, but because of the text field, each value submitted is only distinctive as a “string of author”, not as separate authors.
Best,
I was thinking, that maybe creating a function to get all the field values, separate the authors to arrays, then push those values to the new checkbox fields array – however I am not sure if that would work, to be honest.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 14, 2018 at 11:24 am #18279Hi,
ok thank you anyway.
Is it possible to use the compact box layout for the filter if i use the “hide searchbox mode”?
If it is, it would be great for mobile devices to click the magnifier and get a popup with all the filter, is there a way to build it like that?Kind regards
Tim - AuthorPosts
You must be logged in to reply to this topic.