drupal 7 表单:自定义渲染
drupal_render($form) 一般情况下可以很好地满足我的目的,但在某些情况下我希望表单具有不同的布局样式 (具体来说,我希望所有字段和提交按钮显示在一个水平行中) 有没有办法为特定表单指定不同的渲染,而将其余部分保留为主题的默认渲染?
drupal_render($form) works fine for my purposes in general, but there are cases where I'd like a form to have a different layout style
(specifically I'd like all the fields and submit button to appear in one horizontal row)
Is there a way to specify a different rendering for a specific form, and leave the rest with the default rendering for the theme?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想要更改布局,很可能您想要更改 CSS,而不是标记。
如果你想连续显示所有字段和提交按钮,你可以将它们改为块和“float: left;”他们。
If it's the layout you want to change, most likely, you'd want to change the CSS, not the markup.
If you want to display all the fields and submit button in a row, you could change them into blocks and "float: left;" them.