Home › Forums › Feature Requests › Conditional Logic using Taxonomy field
I would love to have conditional logic extended to use the taxonomy field in order to conditionally show a field based upon if a taxonomy term is selected.
I was wondering if this had been added or if you knew a way to roll my own solution? Basically i’m looking to be able to hide and show fields based on the taxonomy selected.
Hi @seamusleahy
Taxonomy fields are not yet supported in the acf conditional logic triggers.
I would suggest that you write some custom jQuery and add it to the edit page. This jQuery could hide / show the field based on a taxonomy value.
Good luck
Thanks
E
When are you planning to add this feature to the plugin? I’d love to make use of it, and I’m kinda really needing it right now đŸ˜›
Hi Elliot, there are news for “Conditional Logic using Taxonomy field” ?
Thanks,
Davelee
It’s been quite a long time and seems there are still no news. It seems a bit of an important feature to me, that’s why it’s weird you haven’t managed to finally launch it on this amazing plug-in :S
I would love this feature too! Now, the only way to show or hide some fields based upon the taxonomy value is to make a radio button or checkbox field and use that as the conditional logic which seems a bit of a detour…
I’m after this functionality too. Surprised it hasn’t made it’s way into ACF (even as a premium addon) after all this time and the demand.
I’ve created a new ACF taxonomy (checkbox) field and linked it to a WordPress taxonomy. Next I added an ACF checkbox field, added conditional logic, but I don’t see the ACF taxonomy. So I’m not sure if that idea of a workaround was ever going to work?
You’re right, I didn’t even try it myself presuming this would work, but it doesn’t! You CAN make a whole new ACF group based upon a taxonomy term rule by the way, but that clutters up your ACF groups a lot…
I’d like to add a vote for this as well.
That said, failing that, I’d like acf to include filters on conditionals in the same or similar manner as location choices. Currently it is fairly easy to write a plugin to hook into the location rule types, rule values, and rule match. As far as I can tell there is no way to accomplish with the conditional logic component. Of course, it is entirely possible that I’ve missed those filters.
In the meantime, I will probably just use http://www.elliotcondon.com/conditional-logic-for-advanced-custom-fields/
Please, please add this feature. It is a needed key component in a project I’m working on right now. Oh, wouldn’t it be just magical if you were wrapping this up any day now?
One can dream, can’t they?
I’d like to add my vote for this… would be very very useful for a site I’m working on now. I’ll roll my own in the meantime – elliot, thanks so much for your hard work on what is without a doubt the most useful and innovative plugin in existence. Share the love!
@Alancolyer!
Please elaborate on “rolling your own”.
I desperately need this on the site I’m working with.
Do you have any code to share?
Pretty puleez!
@Intrepidrealist basically I created my taxonomy field through ACF, then injected some javascript into the page to show / hide various elements depending on the value of the selected taxonomy term.
To load the custom js I hooked into acf/input/admin_head, the docs here explain how to do that pretty well: http://www.advancedcustomfields.com/resources/acfinputadmin_head/
I then used the acf/setup_fields event in jQuery to do the hiding / showing. This doc page explains how to do it: http://www.advancedcustomfields.com/resources/adding-custom-javascript-fields/?version=4
After that it was just vanilla jQuery to do the heavy lifting.
Hope that helps
EDIT – unfortunately my code is pretty specific to the fields and post types involved so what I’ve written isn’t something you could really copypasta into your own project – but hiding / showing divs using jQuery is something you’ll be able to find plenty of help with online.
The only difficult part is finding out what the IDs of the fields and containing divs are, you’ll need to spend some time in Firebug to get an idea about what to target.
Cheers
Almost two years already, and they still do not care much about this. Thanks!
The topic ‘Conditional Logic using Taxonomy field’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.