Support

Account

Home Forums ACF PRO Show field group (or repeater?) for each taxonomy term

Solving

Show field group (or repeater?) for each taxonomy term

    • mischnu

    • March 24, 2021 at 2:25 am

    Is there a way to show or “repeat” a certain field group for each taxonomy term of a post?

    I my case I need to build a collection of warning signs (each sign is a post). The ‘signs’ post type has a taxonomy ‘languages’ where I can select all available languages for this sign. Here comes the tricky part: For each chosen language I want a field group to show up (one text field and one image field). As the list of languages is not static and can be extended anytime, it’s not an option to pre-generate the fields.

    How would I accomplish this? Thanks for any thoughts or tips!

  • You could create a repeater and have 3 fields for each row; language, text, image.

    Or you could create a hierarchical post type where the parent post was the default language with its image and text and each child post would be an alternate language with its text an image.

    The first will get the job done. The second will likely give you more flexibility, for example if you wanted to list all of the signs in a specific language this can be done easily with a term archive page. This would be extremely difficult to do with the repeater version.

    A variation of the second would be that each sign of each language is a separate post and they are linking together using a bidirectional relationship field, but I don’t think this would give you as much flexibility as the second option.

    • mischnu

    • March 30, 2021 at 7:21 pm

    Thanak you, John, for your advice!

    I think I will give the repeater field a try with the language being a dropdown selection of the language taxonomy terms. My only conern here is that the user can create duplicates of the same language, so maybe I need to find a JS-based solution to suppress this.

    The hierarchical post type sounds interesting as well, I’ve never used this so far. But that would mean that you’d have to edit every language version separately, right? This could maybe get too time-consuming compared to having all the stuff in one place.

    Thanks again,
    Michael

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

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.