简体   繁体   English

Drupal 6主题添加/编辑内容表单

[英]Drupal 6 theme add / edit content form

Drupal 6 theme add / edit content form Drupal 6主题添加/编辑内容表单

In Drupal 6, we can add new content type "content-type". 在Drupal 6中,我们可以添加新的内容类型“ content-type”。 We want to theme /node/add/content-type by template file. 我们想通过模板文件设置主题/ node / add / content-type。 We want to theme the edit form /node/$nid/edit of this content-type also by template file. 我们还希望通过模板文件将此内容类型的编辑表单/ node / $ nid / edit设置为主题。 How to do this? 这个怎么做?

For this you need to understand the naming convention of tpl files in Drupal. 为此,您需要了解Drupal中tpl文件的命名约定。 This link will help https://www.drupal.org/node/1089642 该链接将帮助https://www.drupal.org/node/1089642

According to documentation, 根据文档,

"http://www.example.com/node/1/edit" would result in the following suggestions:

page-node-edit.tpl.php
page-node-1.tpl.php
page-node.tpl.php
page.tpl.php

Either you can try adding content-type in the naming as suggested(I have not tried it personally), or if there are few customization to be done, adding a check like 您可以按照建议的方式尝试在内容中添加content-type(我个人没有尝试过),或者如果要做的自定义很少,则可以添加如下检查

<?php if($node->type == 'content_type_name') ?>

over available variables in "page-node-edit.tpl.php" will also do. 超过“ page-node-edit.tpl.php”中的可用变量也可以。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM