Drupal6自定义内容类型页面主题

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Drupal6自定义内容类型页面主题相关的知识,希望对你有一定的参考价值。

  1. /**
  2.  
  3.   * Override or insert phpTemplate variables into the templates.
  4.  
  5.   */
  6.  
  7. function phptemplate_preprocess_page(&$vars) {
  8.  
  9. // Add per content type pages
  10.  
  11. if (isset($vars['node'])) {
  12.  
  13. // Add template naming suggestion. It should alway use hyphens.
  14.  
  15. // If node type is "custom_news", it will pickup "page-custom-news.tpl.php".
  16.  
  17. $vars['template_files'][] = 'page-'. str_replace('_', '-', $vars['node']->type);
  18.  
  19. }
  20.  
  21. }

以上是关于Drupal6自定义内容类型页面主题的主要内容,如果未能解决你的问题,请参考以下文章