• Resolved Samuel

    (@martdsam)


    Is it possible to activate conditional logic using the values of a taxonomy?

    I tried in several ways but to no avail.

    There is a topic about this in the ACF forum, but it has been requested for 6 years and has never been implemented.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback. I’ve added the feature request in the Trello Board: https://trello.com/c/vO1JEk5m/209-fields-conditional-logic-for-taxonomy-terms-values

    However, I’ll have to take a look if that’s something that can be done. No ETA for the moment tho.

    Have a nice day!

    Regards.

    Thread Starter Samuel

    (@martdsam)

    Thanks for listening.

    It really is a feature that I have seen several requests and no solution. Perhaps some obstacles to doing so.

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Can you please elaborate your feature request, like screenshot example of which conditional logic you’re talking about? (field conditional logic or field group conditional logic)? I need an extended description.

    Regards.

    Thread Starter Samuel

    (@martdsam)

    Taxonomy field:
    https://imgur.com/MsPVQXM

    Any field that may need the taxonomic conditional logic:
    https://imgur.com/YkIACp8

    What I think is that in the conditional logic there should appear the list of the terms of the selected taxonomy.

    In short, the user creates a custom field that contains the terms of a taxonomy.

    Then we create another field that requires the selection of a specific taxonomy term.

    • This reply was modified 4 years, 6 months ago by Samuel.
    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Okay, now I understand why this feature request is still pending on the official ACF forum. The problem come from the fact that fields conditional logic don’t use Ajax, so choices cannot be loaded dynamically (example: render all terms in the select box).

    A workaround would be to let the user enter a term ID manually, or term slugs, but that would leave some spaces for input errors and won’t be very “readable”.

    I know that ACF developer has plans to rework the conditional logic, and he will most probably give necessary tools to achieve this sort of advanced conditional logic.

    Note: In your screenshot, you’re talking about “Taxonomy Terms” field, which is a new field introduced by ACF Extended.

    TBH, I’m overwhelmed with feature requests, so I cannnot guarantee that I can take a look at it before the release of the new conditional logic feature. If I work on it right now, I also takes the risk to have to rework it later in order to make it compatible with the system, something I would like to avoid if possible.

    Regards.

    Thread Starter Samuel

    (@martdsam)

    Yes, I used ACF extended in the example, as I thought it would be easier to understand, since the request was made in this plugin.

    My main need is that taxonomies are natively included in the sitemap of the site, in many cases this is necessary.

    For example:

    Today I have a project with a post type called “real estate”, this post type has a taxonomy called “type”. The type taxonomy has 2 values that are sale and rent. If the user selects to sale a specific group of fields is shown, if for rent the group of fields is already another.

    This makes it easier for the customer not to get lost when registering information or filling in unnecessary fields. So the layout is much cleaner and simplified for usability.

    And I need the URLs to be included on the site map as follows: https://mysite.com/real-state/sale/

    I imagined that it could be something with obstacles, because if it weren’t, maybe it would have already been done.

    However, as in the forum it was said that this would be done in version 5.7, I found it a bit strange.

    https://support.advancedcustomfields.com/forums/topic/conditional-logic-using-taxonomy-field/page/5/

    Thanks for the answer.

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    I understand your problem, but like I said earlier, the field conditional logics don’t use asynchronous requests, which is a limitation on it’s own.

    Because that would mean ACF would have to load every single terms of all taxonomies every time it loads the field group UI, which would lead to a massive performance issue on big websites. This is probably why this solution wasn’t implemented yet.

    The simplest solution, which is working right now with the “Taxonomy Terms” field, is to set the conditional logic “Value equals to 17” (17 being the Term ID).

    Screenshot: https://i.imgur.com/LuBEzzn.png
    Video: https://i.imgur.com/9TIjLnm.mp4

    Regards.

    Thread Starter Samuel

    (@martdsam)

    I understand. This form with the ID will help me.

    Thanks a lot for the help.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Conditional logic taxonomy value’ is closed to new replies.