Plugin Author
scribu
(@scribu)
It seems to me that you should have a single ‘book’ post type plus a custom taxonomy, book-format, which would contain terms like ‘paperback’, ‘ebook’ etc.
Then, based on the format, you could show different bits of information.
This is exactly how the official post formats from WordPress are implemented.
Thanks for the prompt response.
The issue with a format taxonomy is that I want to use a different featured image and [gallery] shortcode for the different formats.
This is important because the website will also have games (another custom post type) in different formats (XBOX 360, PS3, etc) and when the user is filtering (with your Query Multiple Taxonomies plugin) by game format they need to see the correct box cover (featured image) and screenshots ([gallery] shortcode) for their format.
I want to avoid duplication of data for the different formats and ideally share common fields and the related reviews.
I have been working through the examples in the wiki over the last few days and I’m not sure if what I’m trying to achieve is possible.
I am currently making connections (books to books, reviews to books) as seen in the basic structure below.
Hardback and ebook TO Paperback edition:
[Book] The Lord of the Flies (Paperback)
|-- [Book: The Lord of the Flies (Hardback)
|-- [Book: The Lord of the Flies (ebook)
Review TO Paperback edition:
[Book] The Lord of the Flies (Paperback)
|-- [Review] Awesome book
|-- [Review] Timeless classic
|-- [Review] My all-time favourite
My idea is that the hardback and ebook editions check for a connected book (in paperback) and show the reviews from there. In other words they just check for connected reviews from the book that they are connected to.
Is this type of query possible?
Many Thanks
Plugin Author
scribu
(@scribu)
It doesn’t make much sense to connect reviews to specific book formats, IMO. How about having 3 post types:
– book
– book_format
– review
And these connection types:
book <-> book_format
book <-> review
Actually, you could just use normal WP comments instead of the ‘review’ CPT.
Either way, you will have to do two queries:
1. get the book connected to a review
2. get the formats connected to a book
Thanks for the reply. I think I understand what you’re saying so using my example (above) I would create the following:
[book] The Lord of the Flies
|-- [book_format] The Lord of the Flies (Paperback)
|-- [book_format] The Lord of the Flies (Hardback)
|-- [book_format] The Lord of the Flies (ebook)
I presume the [book] posts would be private and I would only display the [book_format] posts publicly on the website.
Have I understood this correctly?
Plugin Author
scribu
(@scribu)
It’s up to you if you display a book with all it’s formats or each book format individually. The connections are the same.
The main idea is to be able to distinguish clearly between the two.