logo
Published on Technical articles on: Windows servers, Apache Web Server, MySQL, PHP, IIS (http://www.sitebuddy.com)

Drupal: Print only on main page (or print on all but the main page)

By chris
Created 10 Oct 2006 - 6:08pm

Print breadcrum on all page except home/front page...
<?php if (!$_REQUEST["q"]=="" && !(variable_get('site_frontpage', 'node')==$_REQUEST["q"]))
print $breadcrumb; ?>

In other words to only print something on the main page use:
if ($_REQUEST["q"]=="" || (variable_get('site_frontpage', 'node')==$_REQUEST["q"])) {
print ....;
}

It appears the following are not reliable or consistant (any longer?):
$is_front
$page == 0


Source URL:
http://www.sitebuddy.com/drupal/snippets/print_only_on_the_home_page