Insights

May 21, 2008

Drupal: Customize Entire Page Template Based On Content Type

I have a couple of projects that call for node content to be published outside of the normal center-of-the-page boundary. But the default template override system accounts for individual nodes, or even overriding the node display area for a given content type, but not the whole page. A Google search turned up some possibilities, but based on this page, I was able to find the right answer for Drupal 5.x, in templates.php:

This means if you have a content type called event and you want it to have a custom page layout, just copy page.tpl.php to page_event.tpl.php. Dunno why this isn’t part of the default theme system, but maybe it’s an un-Drupal thing to want to do.