I'm trying to find instructions on how to remove the node title for just this one page but NOT the rest of the nodes under the same content type.

I've tried adding h2.uber_title page-node-#### with a display of none. H2.uber_title is the CSS that controls the appearance of node titles on my site.

Help!

Comments

drupaledmonk’s picture

If it is only one page that you want to do, a dirty fix would be to create a node-[node-id].tpl.php and remove the title tag from that template or in the page.tpl.php identify the node id and pass the $title in a if loop and print it out when it doesn't match our node id.

Hanscraft’s picture

I read in another question somewhere that the node-[nid].tpl.php method would not work and to use CSS instead.

I think we'll have just a few pages like this (the outside vendor wants to disregard our page template setup!).

Hanscraft’s picture

I've grabbed a page.tpl.php file (my particular page is also a page content type), changed the name to page-####.tpl.php. I then removed the title field. No changes!

Any other ideas? I got the page ID based upon what the node ID was when I hovered over edit in the Content management settings.

Hanscraft’s picture

Update: Fixed It suddenly started working!

So I name the original page file to be page-node-####.tpl.php and ALL of my formatting is lost. I have made no changes to the original file other than name and it lost everything but random babbles of text from the surrounding blocks.

pan0s’s picture

There is a much much more simple and easy way to do this, it is called....
Exclude Node Title

Cheers
Panos

batigolix’s picture

Here you can find information on how to hide the title for specific nodes:

My preferred method is to do this with the theme_preprocess_page() function in the template.php file in the theme folder. This keeps te template clean from "hacky-ish" code.

function YOURHEMESNAME_preprocess_page(&$vars, $hook) {
  // if the page is a node (and e.g. not the front page or a view)
  if (!empty($vars['node'])) { 
    // check if node id is 123, 456 or 789
    if (in_array($vars['node']->nid, array(123, 456, 789))) { 
      // then set an empty title
      $vars['title'] = false;
    }
  }
}