【发布时间】:2016-07-21 13:03:14
【问题描述】:
我有 Drupal 7 站点。它具有自定义内容类型产品。它有 20 个字段。我想控制此内容类型的添加/编辑表单的 UI。
我在 sites/all/modules 下创建了一个模块。
- admin_product
-admin_product.info
-admin_product.module
-admin_product.module
<?php
function admin_product_theme($existing, $type, $theme, $path){
return array(
'product_node_form' => array(
'arguments' => array(
'form' => NULL,
),
'path' => drupal_get_path('theme', 'myTheme').'/templates/forms',
'template' => 'product-node-form',
'render element' => 'form',
)
);
}
在模板中-sites/all/themes/myTheme/templates/forms/product-node-form.tpl.php
-product-node-form.tpl.php
<?php
echo drupal_render_children($form);
echo 'hello template'; // just to test
?>
模板未呈现。
如何控制表单的 UI?
非常感谢任何帮助。
【问题讨论】: