开发者

Drupal node form | Have a .tpl theme file for each node type?

I want to have something like node-type-form.tpl.php in my theme to control the layout of a few of my different content type node forms. I know that I should开发者_Python百科 be able to put something in my template.php to accomplish this.


Look at that module: Node form template


In your template.php, you can create a preprocess function. In this preprocess function, you can edit the template files like this:

if($variables['teaser'] == 1) {
    $variables['template_files'][] = "node-" . $variables['node']->type ."-teaser";
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜