Return to Snippet

Revision: 48284
at June 28, 2011 07:34 by zack


Initial Code
/**
  
       * Override or insert PHPTemplate variables into the templates.
  
       */
   
      function phptemplate_preprocess_page(&$vars) {
 
        // Add per content type pages
  
        if (isset($vars['node'])) {
  
          // Add template naming suggestion. It should alway use hyphens.
  
          // If node type is "custom_news", it will pickup "page-custom-news.tpl.php".
   
          $vars['template_files'][] = 'page-'. str_replace('_', '-', $vars['node']->type);
 
        }
  
      }

Initial URL
http://at-byte.com/technology/drupal-6-custom-content-type-page-theme

Initial Description


Initial Title
Drupal 6 Custom content type page theme

Initial Tags
drupal

Initial Language
PHP