@Component public class CmsPlaceListDirective extends AbstractTemplateDirective
参数列表
path
:页面片段路径
userId
:发布用户id
advanced
:开启高级选项, 默认为false
status
:高级选项:数据状态,【0:操作,1:已发布,2:待审核】
disabled
:高级选项:禁用状态,默认为false
startPublishDate
:起始发布日期,【2020-01-01 23:59:59】,【2020-01-01】
endPublishDate
:终止发布日期,高级选项禁用时不能超过现在,【2020-01-01
23:59:59】,【2020-01-01】
itemType
:数据项类型,【content:内容,category:分类,custom:自定义】
itemId
:数据项id
absoluteURL
:url、封面图处理为绝对路径 默认为true
containsAttribute
:默认为false
,http请求时为高级选项,为true时place.attribute
为推荐位扩展数据map
(字段编码,value
)
orderField
排序字段,【createDate:创建日期,clicks:点击数】,默认发布日期按orderType排序
orderType
:排序类型,【asc:正序,desc:倒序】,默认为倒序
pageIndex
:页码
pageSize
:每页条数
返回结果
page
:PageHandler
page.list
:List类型 查询结果实体列表
CmsPlace
<@cms.placeList path='/1.html' pageSize=10><#list page.list as a>${a.title}<#sep>,</#list></@cms.placeList>
<script> $.getJSON('${site.dynamicPath}api/directive/cms/placeList?path=/1.html&pageSize=10&appToken=接口访问授权Token', function(data){ console.log(data.page.totalCount); }); </script>
限定符和类型 | 字段和说明 |
---|---|
private CmsPlaceAttributeService |
attributeService |
protected FileUploadComponent |
fileUploadComponent |
private CmsPlaceService |
service |
private StatisticsComponent |
statisticsComponent |
ADVANCED, AUTH_TOKEN, AUTH_USER_ID, siteComponent
log
构造器和说明 |
---|
CmsPlaceListDirective() |
限定符和类型 | 方法和说明 |
---|---|
void |
execute(RenderHandler handler) |
boolean |
needAppToken() |
boolean |
supportAdvanced() |
execute, expose, getAdvanced, getApp, getSite, getUserId, needUserToken
execute, getName, getNamespace, getShortName, httpEnabled, setName, setNamespace, setShortName
private CmsPlaceService service
private CmsPlaceAttributeService attributeService
protected FileUploadComponent fileUploadComponent
private StatisticsComponent statisticsComponent
public void execute(RenderHandler handler) throws java.io.IOException, freemarker.template.TemplateException
java.io.IOException
freemarker.template.TemplateException
public boolean supportAdvanced()
supportAdvanced
在类中 AbstractTemplateDirective
public boolean needAppToken()
needAppToken
在类中 AbstractTemplateDirective