$form['name']) 的标记存储在哪里
我不太喜欢 Drupal,但需要弄清楚这个小事情。在 tpl.php 页面之一中有以下内容:
<?php print drupal_render($form['name']); ?>
呈现以下 HTML:
<div id="username-check-wrapper">
<div class="form-item" id="edit-name-wrapper">
<label for="edit-name">Username:
<span class="form-required" title="This field is required.">*</span>
</label>
<input type="text" maxlength="60" name="name" id="edit-name" size="60"
value="" class="form-text required" />
<div class="description">
Must be at least 8 characters and contain no spaces
</div>
</div>
</div>
我需要更改此 HTML,如何找出实际标记的存储位置
I'm not much into Drupal, but need to figure out this little thing. In one of tpl.php page a have following:
<?php print drupal_render($form['name']); ?>
Which renders following HTML:
<div id="username-check-wrapper">
<div class="form-item" id="edit-name-wrapper">
<label for="edit-name">Username:
<span class="form-required" title="This field is required.">*</span>
</label>
<input type="text" maxlength="60" name="name" id="edit-name" size="60"
value="" class="form-text required" />
<div class="description">
Must be at least 8 characters and contain no spaces
</div>
</div>
</div>
I need to change this HTML, how can I figure out where the actual markup is stored
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上,您可以使用挂钩更改此表单: hook_form_alter()。
使用此挂钩,您可以修改表单,添加或删除其中的元素。基本上,您需要创建一个模块才能按照您的方式构建它。
但如果您想采用不同的样式,只需编辑主题中的 css 即可。或者包括另一个特定的。
Actually, you can alter this form using the hook: hook_form_alter().
With this hook, you can modify the form adding or removing elements from it. Basicly, you will need to create a module just to build it in your way.
But if you want to style it differently, just edit the css from your theme. Or include another specific one.