獲取評論列表和評論分頁。
實現類
* com.jspxcms.core.web.directive.CommentListDirective
* com.jspxcms.core.web.directive.CommentPageDirective
**參數**
* siteId:站點ID。多個用英文逗號分隔,如'1,2,5'。默認為當前站點,如果要獲取所有站點的數據,可以傳空字符串''。
* fid:信息ID。
* status:狀態。默認:1(已審核)、2(推薦)。
**范例**
獲取當前站點的評論列表:
~~~
[@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]
~~~
- 標簽基本知識
- InfoList與InfoPage標簽
- NodeList標簽
- NodeList與NodePage標簽
- InfoFulltextList與InfoFulltextPage標簽
- SpecialCategoryList標簽
- SpecialList與SpecialPage標簽
- TagList與TagPage標簽
- CommentList與CommentPage標簽
- FriendlinkTypeList標簽
- GuestbookTypeList標簽
- GuestbookList和GuestbookPage標簽
- Node標簽
- Info標簽
- InfoPrev標簽
- InfoNext標簽
- Vote標簽
- 標簽通用參數
- A標簽
- QuestionList與QuestionPage標簽
- Question標簽
- Query標簽