[wp-hackers] Post types and redundant taxonomy terms

Mike Schinkel mike at newclarity.net
Thu Apr 11 04:49:32 UTC 2013


Hi Josh,

We handled a very similar use-case via a "type" meta field and it has worked out really well.

Applied to your use-case if you were to use our solution you would collapse all posts currently in the post types "video" and "webcast" into the "resource" post type. Then you would use a post meta field called "_resource_type" where you'd assign it values of "general", "video" or "webcast." Next you would display your edit fields based on the resource type. And finally you would collapse your resource categories of "Videos" and "Webcasts" into a single term, maybe "Videos/Webcasts", "Visual Media" or something else that works for you.

In your case those resource types dictate what data entry fields are required, and the resource categories will provide users with filtering capabilities.

You could also use a 2nd "Resource Type" taxonomy instead of a meta field but unless you want to enable all these URLs:

	http://example.com/resource-types/general/
	http://example.com/resource-types/video/
	http://example.com/resource-types/webcast/
and:
	http://example.com/resource-category/white-papers/
	http://example.com/resource-category/tech-guides/
	http://example.com/resource-category/instruction-manuals/
	http://example.com/resource-category/visual-media/

I think post meta works better.

One final thing; if your users still want to filter for "Videos" vs. "Webcasts" then you could have the user's selection of the resource type for a resource auto-assign the resource categories of video and webcast, as applicable.

Hope this helps.

-Mike


On Apr 10, 2013, at 7:34 PM, Josh <joshua.sibelman at gmail.com> wrote:

> Hi all, hopefully my question makes sense. 
> 
> I have an implementation that is working for the problem it was meant to solve, but it's inelegant and seems kludgey, yet it's the best solution I could think of and I wanted to see if anyone else has a better suggestion.
> 
> We have a section of our site for Resources. In this case, it's a listing of terms belonging to a taxonomy named "resource-category". So we have terms like White Papers, Tech Guides, Instruction Manuals, Videos, and Webcasts. We are also using a plugin that allows us to add extra fields to the taxonomy terms, so that the listing can have icons and descriptions.
> 
> Now these are comprised of posts of a few different types. One CPT is simply called "resource" and consists of only a title field, description, and URL to a PDF. This is used for the White Papers, Tech Guides, and Instruction Manuals. Another CPT is called "video" and has some different fields, while the "webcast" CPT has yet another set of fields. 
> 
> All of these CPTs use the "resource-category" taxonomy. So, this works, but it seems redundant to add a post to the video CPT and then have to also add it to the Videos resource category - that said, I can't think of a better solution. 
> 
> Any suggestions?
> 
> Thanks,
> Josh
> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list