Support

Account

Home Forums Pre-purchase Questions Assign a Category to a Field

Solving

Assign a Category to a Field

  • Hi All,
    I would like to create an Employee Information form. This form would contain a whole range of questions with a number of different sections. I would then like to be able to filter by section. E.g.
    –Personal Info–
    Name:
    Address:

    –Licences–
    Drivers Licence:
    Crane Licence:

    –Resume–
    Resume Attachment:

    At the moment I have setup Field Groups for each section and created corresponding Post Types. This works but is cumbersome as it means I need add a separate post for each section. What I would like to do is have a single post with all the questions but be able to assign certain fields to their corresponding category that way I can run a filter to just display the licences of all staff.

    Is this possible?

    Cheers,
    Dan

  • Hi @hexardan

    Hmm… It may not be possible to assign a category to a field. ACF does not have such a functionality.

    May be you could consider a different implementation: Attach all the field groups to a single post, then use meta_query to query the fields and get_field(…) or the_field(…) to display the fields’ value on your templates.

    Have a look at this tutorial for more info on this: http://www.advancedcustomfields.com/resources/query-posts-custom-fields/

    Hope this helps 🙂

  • Thanks James.
    That sounds like a possible work around.
    The problem I then have is with filtering.
    Here’s a link to what i’ve created so far (it’s rough):
    http://incadesigndev.com/ncstaff/

    I’m using the Search & Filter plugin.

    Cheers,
    Dan

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

The topic ‘Assign a Category to a Field’ is closed to new replies.