drupal7重写默认article form

原创
2014/01/08 22:08
阅读数 82
/**

* hook_theme()  //在你的module下面添加,如果你想添加到自己的theme下面,你可以直接写在theme下面的hook_theme下面即可

*/

function my_module_theme($existing, $type, $theme, $path){

return array(

'article_node_form' => array(

'render element' => 'form',

'template' => 'template/path_test_three',

),

);

}

然后在my_module/template/path_test_three.tpl.php里面将form重写

<?php print render($form['title']);?>

<?php print render($form['body']);?>   //前面的输出就是为了布局

<?php print drupal_render_children($form) ?>    //这句话用于生成该完全的form

类似的,你要重写登录与注册表单,都是一个原理。

想阅读更多资料,请到官网阅读

https://drupal.org/node/1092122

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
0 收藏
0
分享
返回顶部
顶部