您可以在主题的template.php或自定义模块中自定义您的内容类型表单。这是记录here。例如,如果您使用自定义内容类型文章有一个自定义模块在你的主题Mymodule中,那么你可以自定义,像这样:
<?php
/**
* Implements hook_theme().
*/
function MYMODULE_theme($existing, $type, $theme, $path) {
return array(
'article_node_form' => array(
'render element' => 'form',
'template' => 'article-node-form',
// this will set to module/theme path by default:
'path' => drupal_get_path('module', 'MYMODULE'),
),
);
}
?>
要输出的自定义数据:
<?php
/**
* Preprocessor for theme('article_node_form').
*/
function template_preprocess_article_node_form(&$variables) {
// nodeformcols is an alternative for this solution.
if (!module_exists('nodeformcols')) {
$variables['sidebar'] = array(); // Put taxonomy fields in sidebar.
$variables['sidebar'][] = $variables['form']['field_tags'];
hide($variables['form']['field_tags']);
// Extract the form buttons, and put them in independent variable.
$variables['buttons'] = $variables['form']['actions'];
hide($variables['form']['actions']);
}
}
?>
查看https://drupal.org/node/17565以获取有关如何通过内容类型实现主题节点的信息。 –
可以肯定,你想要的是为每个组添加另一个标题(除了不可见的标题之外)或者是否希望使不可见标题可见?如果是第二部分,我同意@nmc答案和模板文件。 – Djouuuuh
谢谢@justinelejeune,但是如何为每个组添加标题?我没有看到一个选项...只是为用户添加内容的字段。 – Cybercampbell