Variable to check if the page is of some other Content Type The variables $page and $teaser are very helpful but is there a way to check if I'm in a different kind of Content Type? For example, if I made a content type named Products, what can I type in my template file page.tpl.php which will display HTML only if the page being viewed is of type Products?
Place this in your theme's template.php, replacing 'THEMENAME' with the name of your theme:

function THEMENAME_preprocess_page(&amp;$variables, $hook) {
  $variables['some_html'] = '';
  if (isset($variables['node']) &amp;&amp; $variables['node']-&gt;type == 'product') {
    $variables['some_html'] = '&lt;p&gt;Hello world!&lt;/p&gt;';
  }
}


And use this in your page.tpl.php:

&lt;?php print $some_html; ?&gt;


Alternatively, if you want to keep the HTML string in your template file, I would do this in template.php:

function THEMENAME_preprocess_page(&amp;$variables, $hook) {
  $variables['print_extra_header'] = false;
  if (isset($variables['node']) &amp;&amp; $variables['node']-&gt;type == 'product') {
    $variables['print_extra_header'] = true;
  }
}


And use this in page.tpl.php:

&lt;?php if ($print_extra_header) : ?&gt; &lt;h1&gt;THIS GETS PRINTED&lt;/h1&gt; &lt;?php endif; ?&gt;


Make sure to clear the cache after creating the THEMENAME_preprocess_page function, otherwise Drupal will not know it's there and it will not run.