Drupal 和评论表
我需要将评论表单直接插入到节点模板中(我使用 node-type.tpl.php 来主题化节点类型)。
在相关问题中,如果我转到/comment/reply/NID,我会收到评论表单,但它只有“预览”按钮,没有提交按钮。按下预览按钮时不会执行任何操作。
感谢您的帮助!
I need to insert the comment form directly to the node template (I use node-type.tpl.php to theme the node-type).
In related issue, if I go to /comment/reply/NID I get the comment form, but it's got only "preview" button, and no submit button. the Preview button does nothing when pressed on.
Thanks for the help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查“admin/content/node-type/yourNodeType”下的节点类型评论设置。在评论选项的(通常折叠的)字段集中,您可以选择是在单独的页面上还是在与节点相同的页面上显示评论表单。
至于缺少的提交按钮,您可以将“评论预览”的设置从强制更改为可选。
至于预览按钮什么都不做,这听起来很奇怪,我不知道可能会导致这种情况的原因 - 按下它通常会导致预览输入的评论,并可以选择最终提交它。如果此问题仍然存在,您应该为此提出一个单独的问题。
Check your node-type comment settings under 'admin/content/node-type/yourNodeType'. Within the (normally collapsed) fieldset for the comment options, you can choose whether to display the comment form on a separate page or on the same page as the node.
As for the missing submit button, you can change the setting for 'comment preview' from mandatory to optional.
As for the preview button doing nothing, this sounds strange and I have no idea what might cause this - pressing it would normally lead to a preview of the entered comment, with the option to finally submit it. If this problem persists, you should open a separate question for that.
评论表单不在node-type.tpl.php 的范围内。从技术上讲,您可以通过变量预处理将其添加到那里。但这将带来一系列全新的问题。
因此,不幸的是,您需要退后一步,将评论表单主题设置在其他地方。
节点
节点内容
评论表单
评论
是不可能的
node
节点内容
评论包装
评论表单
评论
是要走的路。
请参阅 http://api.drupal.org /api/drupal/modules--comment--comment-wrapper.tpl.php
首先
Comment form is not in scope in node-type.tpl.php. Technically you could add it there trough variable preprocessing. But that will introduce a whole new set of problems.
So, unfortunately, you will need to do a step back, and theme the comment-form elsewhere.
node
node-content
comment-form
comments
is not possible
node
node-content
comment-wrapper
comment-form
comments
however, is the way to go.
see http://api.drupal.org/api/drupal/modules--comment--comment-wrapper.tpl.php
for a starter