[support] Overriding page.tpl.php for node type...

Scott Matthews smatthews at optaros.com
Fri Apr 10 12:52:40 UTC 2009


This should be a simple question and answer...

I know that a basic premise of Drupals theme hierarchy should be that if I want a page for a specific node I make a file page-[type].tpl.php.  I have done this and I still get a "Page not found" issue.  Creating a node-[type].tpl.php works for overriding the node template for the specific node type.

Does anyone have any suggestions for what might be missing from the out of the box Drupal solution to get this working?

I've tried adding the following function to my template.php which I found on a forum post previously but with no success:

function _phptemplate_variables($hook, $vars) {
    if ($hook == 'page' && isset($vars['node'])) {
        $vars['template_files'][] = 'page-'.str_replace('_', '-', $vars['node']->type);
    }
    return $vars;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.drupal.org/pipermail/support/attachments/20090410/988e8e0c/attachment-0001.htm>


More information about the support mailing list