如何让 Content types为supply 的page ,显示的时候调用的是page-supply.tpl.php

由 peterpan_sh 于 周四, 2008-07-24 19:28 提交。

我建立了 Content types 名为: supply .
如何让 Content types为supply 的page ,显示的时候调用的是page-supply.tpl.php

是node-supply.tpl.php这样

是node-supply.tpl.php这样吧?

--------------AD-----------------
http://www.petkk.com

不是,node-supply.tpl.php

不是,node-supply.tpl.php 可以调用了.我另外需要使用page-supply.tpl.php, 这样和原来的page.tpl.php区分开.

参考:http://drupal.org/no

参考:http://drupal.org/node/104316
2个办法:
1、根据你的nodetype来判断
参考:http://drupal.org/node/249726

2、根据你的url来判断。
参考:http://drupal.org/node/139766

总的来说就是利用drupal强大的hook功能,在你的theme里的template.php的函数_phptemplate_variables中来设定变量$vars['template_files']

drupal5.X下是没有问题,6.x下没有试过:D

嘿嘿

嘿嘿 ..
http://drupalchina.org/node/3646
看这儿 ..

---------------------------------------------------
http://Evance.name