@Component public class CmsContentListDirective extends AbstractTemplateDirective
参数列表
categoryId
:分类id,当parentId为空时有效
containChild
:是否包含子分类,【true,false】
categoryIds
:多个分类id,当categoryId为空时有效
modelId
:多个模型id
parentId
:父内容id
onlyUrl
:外链,【true,false】
hasImages
:拥有图片列表,【true,false】
hasFiles
:拥有附件列表,【true,false】
hasProducts
:拥有产品列表,【true,false】
hasCover
:拥有封面图,【true,false】
userId
:发布用户id
startPublishDate
:起始发布日期,【2020-01-01 23:59:59】,【2020-01-01】
endPublishDate
:终止发布日期,高级选项禁用时不能超过现在,【2020-01-01
23:59:59】,【2020-01-01】
advanced
:开启高级选项, 默认为false
status
:高级选项:内容状态,【0:操作,1:已发布,2:待审核,3:驳回】
disabled
:高级选项:禁用状态,默认为false
emptyParent
:高级选项:父内容id是否为空,【true,false】,当parentId为空时有效
title
:高级选项:标题
absoluteURL
:url处理为绝对路径 默认为true
absoluteId
:id处理为引用内容的ID 默认为true
orderField
排序字段,【score:评分,comments:评论数,clicks:点击数,publishDate:发布日期,updateDate:更新日期,checkDate:审核日期】,默认置顶级别倒序、发布日期按orderType排序
orderType
:排序类型,【asc:正序,desc:倒序】,默认为倒序
firstResult
:开始位置,从1开始
pageIndex
:页码,firstResult不存在时有效
pageSize
:每页条数
maxResults
:最大结果数
返回结果
page
:PageHandler
page.list
:List类型 查询结果实体列表
CmsContent
<@cms.contentList pageSize=10><#list page.list as a>${a.title}<#sep>,</#list></@cms.contentList>
<script> $.getJSON('${site.dynamicPath}api/directive/cms/contentList?pageSize=10', function(data){ console.log(data.totalCount); }); </script>
限定符和类型 | 字段和说明 |
---|---|
private CmsContentService |
service |
private StatisticsComponent |
statisticsComponent |
ADVANCED, AUTH_TOKEN, AUTH_USER_ID, siteComponent
log
构造器和说明 |
---|
CmsContentListDirective() |
限定符和类型 | 方法和说明 |
---|---|
void |
execute(RenderHandler handler) |
boolean |
supportAdvanced() |
execute, expose, getAdvanced, getApp, getSite, getUserId, needAppToken, needUserToken
execute, getName, getNamespace, getShortName, httpEnabled, setName, setNamespace, setShortName
private CmsContentService service
private StatisticsComponent statisticsComponent
public void execute(RenderHandler handler) throws java.io.IOException, java.lang.Exception
java.io.IOException
java.lang.Exception
public boolean supportAdvanced()
supportAdvanced
在类中 AbstractTemplateDirective