This all sounds great. My client needs such a thing. But does it works with the views module? And which versions are needed? I would love to hear your experience.
Amnon
This all sounds great. My client needs such a thing. But does it works with the views module? And which versions are needed? I would love to hear your experience.
Amnon
Comments
Comment #1
lemark commentedI'm not sure if I clearly understand your question.
Bundle Inherit module itself is not integrated with Views module. However, if you need to create views based on inherited entities (content types) it is no need in any kind of special integration. So yes, you can create views on inherited content types.
Comment #2
jordisan commentedlemark,
I think one possible feature would be adding a "FILTER BY CONTENT TYPE AND ITS SUBTYPES" in views, so you could filter all nodes belonging (or not belonging) to a content-type or any of its inherited subtypes; or better, add a checkbox "include subtypes" in current content-type filter.
Nowadays, I think the only way to do that is selecting individually every content subtype.
By the way, nice job! I've been searching for subtyping functionality for a while for my personal project, and I think it's currently the best way to create content subtypes. Don't let this module die :)
Comment #3
autopoietic commentedThe Content Type Groups module allows views integration - eg filter by nodes of a type that is within a 'content type group'.
Using this module in parallel with bundle inherit would be one way of creating sensible and reusable filter groups, prior to any direct views integration from bundle inherit. You would have to create the 'content type groups' to match your inheritance families manually in the ui (or there is an API).
Comment #4
itangalo commentedThis patch provides some Views integration for bundle_inherit_node, exposing the parent content type to Views for filtering (and also display and sorting).
The patch does not provide means to filter on content type *or* the content *parent* type, but this can be accomplished using Views' neat "or" functionality for filters.
The patch depends on this patch: http://drupal.org/node/1701566#comment-6277708 (just renaming the table defined by bundle_inherit).
Comment #5
itangalo commentedHere's a short video showing how to use the patch: http://youtu.be/DEA7iIUib3o
Comment #6
itangalo commentedUpdated with a new patch. The previous one would fail if two bundles share the same machine name. (That is if, say, a vocabulary and a content type share the same name.)
Also updating issue title.
Comment #7
alexweber commentedThanks for the great work, going to check this out as I need this for a project.
Comment #8
alexweber commentedThanks for the patch Johan! I was just recently give co-maintainership by lemark and I'll take a look at this and hopefully commit it in preparation for a stable beta version!
Comment #9
alexweber commentedComment #10
itangalo commentedAnother update to the patch!
Thanks to http://grasmash.com/article/demystifying-views-api-developers-guide-inte..., I now know a better way of adding additional conditions to a Views query, so there is no need to have a special relationship handler. Simpler patch attached.
Comment #11
alexweber commentedJohan, the patch failed to apply against 7.x-1.x-dev (we committed a bunch of stuff yesterday)
Could you please re-roll?
Thanks!
Comment #12
itangalo commentedWill do! I'll get back tomorrow with a new patch.
Comment #13
itangalo commentedRe-rolled against 1.x-dev!
Comment #14
alexweber commentedAwesome, thanks! I'll take a look at it as soon as I get home later on tonight :)
Comment #15
alexweber commentedCommitted in 886a8ff, thanks! :)
Note, this patch depends on #1701566: Change bundle_hierarchy to bundle_inherit? which will get committed in a few minutes.