john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

drupal 6 hide title in page

drupal-6-hide-title-in-page

Despite the many moans and whining about Drupal (myself included), I do admit that it gives you a robust and flexible framework to come up with a solution.

(E.g. custom blocks where you can but a nice image banner / anything else)

In this case I do not want to display the title (yes, the webpage will still have a title for Search Engine Optimization)... This is for my special cases such as: "home", "login", etc.

Many of the messy hacks I found on the internet were correct in their direction but poorly implemented... I mean removing the display of the title on every "Page" is a bit overkill...


A more flexible long term solution is:

  1. Create a new content type called page_without_title a. Admin -> content type -> add content type b. create content (e.g. login) Home -> Create Content

  2. Modify your theme's template.tpl to not show title for that content type

// Titles are ignored by content type when they are not desired in the design. //added 2010-07 johnpfeiffer $vars['original_title'] = $vars['title'];

if ( !empty($vars['node']) && in_array($vars['node']->type, array('page_without_title') ) ) { $vars['title'] = ''; }

} ?>


NOTE that we are NOT modifying the "" section in page.tpl.php...

<?php print $head ?> <?php print $head_title ?>


The SIMPLE one page hack is to merely change


An ideal solution would be a simple module that would allow you to pick which pages (either by content node number or alias) where you do not want certain elements displayed (e.g. title).


  • « drupal 06 login block menu
  • Win CE Vertical Rectangle Click »

Published

Aug 1, 2010

Category

drupal

~238 words

Tags

  • 6 13
  • drupal 43
  • hide 2
  • in 17
  • page 3
  • title 1