问题描述
Drupal 会自动在表单项周围添加 <div> 和类.所有表单元素都将具有属性 class = "form-item"
.如何覆盖此默认行为?
Drupal automatically adds <div>'s and classes around form items. All form elements will have the attribute class = "form-item"
. How do I override this default behavior?
推荐答案
如果你坚持要改,在theme_form_element 函数.您可以通过将该函数复制到主题的 template.php 文件并将其重命名为 THEMENAME_form_element(用您的主题名称代替THEMENAME")或 phptemplate_form_element 并删除添加类的部分来覆盖它.
If you insist on changing it, it's added in the theme_form_element function. You can override it by copying that function to your theme's template.php file and renaming it THEMENAME_form_element (substituting the name of your theme in place of "THEMENAME") or phptemplate_form_element and removing the part that adds the class.
这篇关于删除 class="form-item"来自 Drupal 表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!