creative insites header

Load a custom page-xxxx.tpl.php file for Drupal

January 5th, 2012 Snippets

This snippet is so you can override page.tpl.php and create a custom layout for page-some-content-type.tpl.php and it will override using the page.tpl.php template.

Add this code between the head tags in your page.tpl.php file.

<?php if ($node->type == 'some-content-type'):  ?>
        <?php include 'page-some-content-type.tpl.php'; /*load a page-some-content-type.tpl.php */
       
return;  ?>
  
  
<?php endif; ?>

Replace, "some-content-type" with the name of the content type's page you are trying to change.