Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

Module Monday: Content Type Groups

Parent Feed: 

on October 7, 2013 //

Keep your content types in order, and simplify your views

By the time most large Drupal sites have been around for a year or two, they've accumulated a menagerie of content types. Articles, press releases, product pages, reviews, biographies, landing pages, home pages, promo rotators, photo galleries, and more litter the list of content, and making sure they're treated consistently can be a problem.

A view that was created last year, for example, might have displayed just the right list of content types then, but who's making sure the new stuff gets handled properly? The Content Type Groups module can simplify that problem: it lets administrators define groups of content types for organizational purposes.

Picture of the Content Type Groups admin screen

Once installed, the module adds a new administration page to Drupal's Structure section. Admins can define new Groups and assign content types to them -- they're not exclusive, so one content type can belong to multiple groups if it makes sense. The most important impact of these groups felt when building Views. If you're adding content type filters (or contextual filters) to a listing page, you can use a Content Type Group filter instead. Building a view that lists "All news content types" or "All user-created content types" rather than specifying each type individually makes it easier to ensure that future changes and additions will ripple through to previously-created views.

Picture of the Content Type Groups views filter page

While the concept is simple, the module's execution is perfect. The admin screens are self-explanitory and easy to use, the Views integration works nicely, and the content type groups can be exported as part of a Feature module. In the future, it would be great to leverage group information to organize the often-overwhelming "Add New Node" overview page. For now, though, Content Type Groups is a great tool for future-proofing Views and documenting the intended purpose of a site's varied content types.

Jeff Eaton

Senior Digital Strategist

Want Jeff Eaton to speak at your event? Contact us with the details and we’ll be in touch soon.

Author: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web