How to hide a node title?
Posted July 4th, 2007 by DrupalaceSo a client wants a site with a custom front page. After struggling with Panels and a number of options, I decided the easiest way to go about this particular request was a regular node, with blocks turned off.
One problem: the node's title was also appearing at top, messing up the graphic look needed. I wanted no title to appear, but Drupal doesn't allow a node without a title, and there's no built-in way to have a node appear with its title invisible.
Question answer
Searching the drupal.org forums turns up a lot of possible solutions, most complex. But among the many solutions on this page http://drupal.org/node/2420, one by donnoit looked simple enough even for me:
Edit page.tpl.php in your theme dir and change the line that checks title != "" to title != "x". Then simply give x as the title to your page and it shouldn't show up.
Okay. I opened page.tpl.php for the theme in question, found this line
<?php if ($title!): ?><h1 class="title">
<?php print $title; ?></h1><?php endif; ?>
and changed it to this:
<?php if ($title!="welcome"): ?><h1 class="title">
<?php print $title; ?></h1><?php endif; ?>
where "welcome" (without quotes) is the title of my front-page node.
It works! The node content appears, but Drupal doesn't print out its title. Thanks, donnoit!












