获取评论列表和评论分页。
com.jspxcms.core.web.directive.CommentListDirective
com.jspxcms.core.web.directive.CommentPageDirective
'1,2,5'
。默认为当前站点,如果要获取所有站点的数据,可以传空字符串''
。获取当前站点的评论列表:
[@CommentList limit='8';list]
[#list list as comment]
${comment.creator.username}: ${comment.text!?html}
[/#list]
[/@CommentList]
获取当前文章的评论列表(详细页有默认的info对象,可以直接使用):
[@CommentList fid=info.id limit='8';list]
[#list list as comment]
${comment.creator.username}: ${comment.text!?html}
[/#list]
[/@CommentList]
分页标签示例(Param.fid可以获取从url的参数,如/comment.jspx?fid=78
,可以在模板中使用Param.fid
获取值):
[@CommentPage fid=Param.fid pageSize='20';pagedList]
[#list pagedList.content as comment]
${comment.creator.username}: ${comment.text!?html}
[/#list]
[#--包含分页模板--]
[#include 'page.html'/]
[/@CommentPage]