twentyfourhoursmedia / comments-work
为Craft CMS 3提供的易于使用的评论插件
1.3.0
2021-02-23 08:46 UTC
Requires
- craftcms/cms: ^3.0.0
- dev-master
- 1.3.0
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.14
- 1.1.12
- 1.1.10
- 1.1.9
- 1.1.7
- 1.1.5
- 1.1.0
- 1.0.7
- v1.0.6.x-dev
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.0
- dev-fix/multi-site
- dev-fix/fix-asset-naming
- dev-feature/check-authorized-event
- dev-feature/poll-19-add-indices-to-optimize-the-new-group-by-clauses
- dev-craft34-update
- dev-comments-work-7
- dev-elementquery-support
This package is auto-updated.
Last update: 2024-09-23 16:42:02 UTC
README
为Craft CMS 3.x提供的易于使用且直观的评论插件。允许用户在您的内容上发布评论,并在仪表板上进行管理。
文档
请参阅我们的在线文档资源了解更多信息
Comments Work概览
- 将用户评论添加到任何类型的元素中,例如用户和内容项
- 在CP中获取提交的评论的精美概览
- 管理:在CP中删除、批准或标记为垃圾邮件
- 管理:在CP中修改评论内容
- 评论表单已签名,恶意用户无法提交任意内容的评论
使用方法
以下是前端代码的快速示例。更多信息请参阅
- https://io.24hoursmedia.com/comments-work/show-comment-entries-on-a-page
- https://io.24hoursmedia.com/comments-work/form
{# @var commentsWork \twentyfourhoursmedia\commentswork\services\CommentsWorkService #}
{% set commentsWork = craft.commentsWork.service %}
<div id="comments">
<br/>
<p>{{ commentsWork.countComments(entry) }} comments</p>
{% set comments = commentsWork.fetchComments(entry, 0, 10) %}
{% for comment in comments %}
{# @var comment \twentyfourhoursmedia\commentswork\models\CommentModel #}
<div class="card card bg-light">
<div class="card-body">
<div class="row">
<div class="col-md-2">
<img src="https://image.ibb.co/jw55Ex/def_face.jpg" class="img img-rounded img-fluid" width="64">
<p class="text-secondary text-center">{{ comment.dateCreated | date }} {{ comment.dateCreated | date('H:i') }}</p>
</div>
<div class="col-md-10">
{%- if comment.user %}<p><a href="https://maniruzzaman-akash.blogspot.com/p/contact.html"><strong>{{ comment.user.friendlyName }}</strong></a></p>{% endif -%}
{%- if comment.title is not empty %}
<p><strong>{{ comment.title }}</strong></p>
{% endif -%}
{%- if comment.comment is not empty %}
<p>
{{ comment | commentAsHtml }}
</p>
{% endif -%}
</div>
</div>
</div>
</div>
<br/>
{% endfor %}
</div>
要求
此插件需要Craft CMS 3.0或更高版本,并且与PRO版配合使用效果最佳。(其他版本不支持用户)
安装
要安装此插件,请遵循https://io.24hoursmedia.com/comments-work/installation中的说明
配置Comments Work
有两种配置选项。在管理CP中,转到“设置”->“Comments Work”。更多信息请参阅https://io.24hoursmedia.com/comments-work/configuration
- “自动批准评论” - 如果启用,评论将立即在网站上显示。这绕过了管理。当启用匿名评论时,不建议使用!
- “允许匿名评论” - 允许匿名用户发布评论。
由24hoursmedia提供