Headers are inserted regardless of what page they're on. I want to keep the header for certain pages (forums, namely), and remove them for other things. Similarly, I want forum breadcrumbs but nowhere else. How could I set it up so my forum displays these things without them appearing on other pages?

Comments

sumitshekhawat7331’s picture

hi for this you have to write some php code in your page.tpl.php its not a tough task...

rory--’s picture

What exactly am I looking to do, though? Do I alter the title/breadcrumb code? If so, what conditionals am I attempting?

sumitshekhawat7331’s picture

I did this type of thing in my site and i have written some code in page.tpl.php

In your page.tpl.php file you will find this line replace with these codes

  <?php if ($breadcrumb): print $breadcrumb; endif; ?>

you can use these codes

1)

<?php if ($node->type == 'forum') print $breadcrumb; ?>

or

2)

<?php
if($_GET['q']=='forum'){
print $breadcrumb ;
}
else{
}
?>

or

3)

<?php
if (arg(0) == 'node' && is_numeric(arg(1))) {
    
  $result = db_query("SELECT nid FROM {node} WHERE nid = %d AND type = 'forum'", arg(1));
  if (db_num_rows($result) > 0) {
    print $breadcrumb;
  }
}
?>
geerlingguy’s picture

Thanks for the suggestions - I used the following snippet to set the breadcrumb to only display on blog pages, admin pages, and the main blog page:

<?php if ((arg(0) == 'admin' || arg(0) == 'blog' || $node->type == 'blog') && $breadcrumb): ?>
  <div id="breadcrumb" class="nav"><?php print $breadcrumb; ?></div> <!-- /breadcrumb -->
<?php endif; ?>

__________________
Personal site: www.jeffgeerling.com