开发者

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

开发者 https://www.devze.com 2022-12-15 16:42 出处:网络
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 i

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

精彩评论

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