将表单插入到 Drupal 的块中? [英] Inserting a form into a block in Drupal?
本文介绍了将表单插入到 Drupal 的块中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有任何命令或方法可用于将表单(例如用户注册表)的内容插入块中?
Is there any command or method that I can use to insert the contents of a form (e.g. the user registration form) into a block?
推荐答案
drupal_get_form($form_id)
- 把它放在一个模块的 hook_block
($op=='view') 或者甚至...... 不寒而栗... 在启用 PHP 过滤器的块内.
drupal_get_form($form_id)
- put it in a module's hook_block
($op=='view') or even... shudder... inside a block with PHP filter on.
您需要先找到表单 id - 在表单中查找名称为 form_id
的隐藏 input
.它的值应该是表单 id.
You need to find the form id first - look for a hidden input
with the name form_id
within the form. Its value should be the the form id.
此外,您可以简单地使用 Form Block 模块.
Also, you could simply use the Form Block module.
这篇关于将表单插入到 Drupal 的块中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文