ACF Author field

This topic contains 4 replies, has 2 voices, and was last updated by echse echse 4 years, 12 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #18206
    echse
    echse
    Participant

    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, author4

    If 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
    [ ] author3

    Thank you very much.
    Kind regards
    Tim

    #18221
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi 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
    2. ..or simply enter the author names manually to the filter, instead of using the {get_field} syntax

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #18228
    echse
    echse
    Participant

    Thank 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
    Tim

    #18235
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi 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.
    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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #18279
    echse
    echse
    Participant

    Hi,

    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

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.