Pedro Posada | Remove Page title based on node type

Remove Page title based on node type

Posted on June 5, 2009 - 3:37pm
<< 15 of 50 >>

Quick and easy php snippet to have the page title not show on only certain node types.

Copy and paste the code below inside your template.php file.

<?php
function mythemename_preprocess_page(&$variables){
    if(
$node = menu_get_object()){
        if(
$node->type == 'my_node_type'){
           
$variables['title'] = '';
        }
    }
}
?>

Works on Drupal 6

Submitted by HS (not verified) on February 8, 2010 - 7:45am.

Where does this go?

An example of how you have implemented this on your page.tpl file will be handy.

Submitted by pedro on February 8, 2010 - 1:02pm.

The code goes in the /sites/themes/mytheme/template.php file.

This is for drupal 6.

You don't have to modify the page.tpl.php at all. The prepocess function can modify all the variables in the page.tpl.php before they are printed out.

Hope this helps.

Post new comment

The content of this field is kept private and will not be shown publicly.
Please solve the math question. This way we will know you are not a robot.