Home › Forums › General Issues › Books & authors – bidirectional relationship or custom taxonomy?
Hi,
I have a conceptual question. Think about the example books and authors. I made a webshop that sells books. BOOKS (WooCommerce products) have different attributes for description and filtering.
They also have a bidirectional relationship with AUTHORS. So there is also the CPT author, that also comes with some fields and images to describe them.
Now, I realize I could also create a custom taxonomy for the WooCommerce product (book). I was not aware that I can add custom fields to a custom taxonomy, i.e. it will server like a category but at the same time describe the category in more detail with custom fields.
I am asking myself now: would it be better to assign the custom taxonomy to the books, instead of creating a separate CPT author and bidirectional relationship?
(actually, it’s composers and musical pieces but easier to comprehend with books and authors)
best regards
Markus
I don’t see any difference one way or the other except for one thing.
Lets say that in the future you wanted to group the authors by genre, Sci-Fi, Historical, Non Fiction, etc. It would be pretty much impossible to do this with authors being a taxonomy. On the other hand as a CPT you could add a genre taxonomy attached to the author as well as the books so that both authors and books could be sorted into these terms.
As far as future proofing it I would go with a CPT.
Thanks a lot John! This kind of input is so much of value, as it’s important to know what to do before figuring out how to do it.
I discussed this with someone else as well and she suggested even a complete other approach by using WooCommerce attributes instead of CPT and instead of a custom taxonomy. Many opportunities out there.
Thanks for explaining
WC attributes are nothing more than a built in taxonomy system. The attributes you create for example “Author” are child taxonomies.
You must be logged in to reply to this topic.
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.