Module Monday: Exclude Node Title

How to Hide Node Titles and Configure Content Display in Drupal 7

Drupal's content modeling tools are unmatched in the open source CMS world: CCK and Drupal 7's FieldAPI give site builders a remarkable amount of control over every content type, its fields and properties, and how they're edited and displayed. Except, that is, for the Title field. Some content types, like links to other web sites or quotations, don't lend themselves to catchy titles; displaying the primary content underneath an additional title can sometimes dull the impact of the node's the primary information. That's where the Exclude Node Title module comes in.








Screenshot of administration screen

Once the module is enabled, it adds a centralized settings form that allows you to configure each content type on the site. For each one, you can choose whether to hide or show the title, which display modes should keep it hidden, and whether the display option should be controlled on a node-by-node basis by the author of each piece of content. When the affected nodes appear in listings like the front page or standard Views, voila: no node titles!








Screenshot of resulting change to site

If you've ever performed this trick yourself using theme preprocessing hooks, you'll recognize what's going on: Exclude Node Title module module is just removing the 'title' element from the rendered output of a node, and when it hits the node HTML template, there's nothing to print. The difference, of course, is that using a dedicated module allows you to drive the behavior entirely using configuration settings, rather than custom code in your theme or a site-specific module.

The only hitch I could find is that the option to hide a node's title on the edit form doesn't seem to work. The title is hidden on teasers, full node views, and more -- but the Title field stubbornly appears on the edit form itself. If you want to make sure your nodes have some kind of title for administration screens, the Auto Node Title module would make a good companion. It can hide the Title field and populate it with a default value.

Get in touch with us

Tell us about your project or drop us a line. We'd love to hear from you!