This project is not covered by Drupal’s security advisory policy.
What is this module all about?
The Bundle Terms module enables administrators to tag entity bundles with taxonomy terms. The idea may seem crazy, but before you take out your pitchforks, look at a use case!
You've created a bunch of node types:
- Fire Trucks
- Fire Stations
- Firemen
- Police Cars
- Police Stations
- Policemen
You'd like to have a view that shows all of the node types related to 'Police', and another view showing all of the node types with related to 'Fire'. Using Bundle Terms, you can create those views without tagging any nodes.
Why would I use this module? Doesn't taxonomy already do something like this?
Yes, the core taxonomy module can replicate this behavior of these views, but it would require much more data being saved to your database. For large sites with many nodes, using core taxonomy functionality may not be a viable option.
The real difference is this: The core taxonomy module requires you to create a data point once per entity. Bundle Terms allows you to create a data point once per entity bundle. That's many fewer data points in your database.
To carry on with our example, Bundle Terms would require roughly three data entries in order to tag Fire Trucks, Fire Stations, and Firemen with the term "Fire." On the other hand, core taxonomy would need to tag every single node of type Fire Trucks, Fire Stations, and Firemen.
What kind of black magic, Drupal sacrilege is this?
Wait! It's actually pretty Drupally. Here's what's going on behind the scenes:
- A new 'bundle terms' taxonomy vocabulary is created.
- Each taxonomy term in the 'bundle term' vocabulary has a 'content type' field.
- If you'd like to associate a node type with term, you update the 'content type' field for that term.
So what you're really doing is tagging a taxonomy term with a content type, not the other way around. This leverages the fact that taxonomy terms are entities in Drupal 7, and makes data storage much more efficient. Not so crazy, right?
Views Integration
This module would be fairly useless without views integration. I highly recommend enabling the default view that is shipped with this module, nodes_by_bundle_term. But, if you'd like to set up your own view that can be filtered by Bundle Terms, follow these steps:
- Create a new view with base table Node
- Add a "Content: Type:" relationship
- Add a "Node Type: Bundle terms bundle" relationship
- Add a "Bundle Term Bundles: Bundle term" relationship
- Add a "Taxonomy Term: Term" filter
You can now filter nodes by bundle terms.
Disclaimers
This module currently works only with nodes. It can be fairly easily extended to other entity types by extending views integration.
Project information
Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Content editing experience
- Created by grasmash on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
