类 CmsPlaceListDirective
java.lang.Object
com.publiccms.common.directive.BaseTemplateDirective
com.publiccms.common.base.AbstractTemplateDirective
com.publiccms.views.directive.cms.CmsPlaceListDirective
- 所有已实现的接口:
Directive,HttpDirective,freemarker.template.TemplateDirectiveModel,freemarker.template.TemplateModel
placeList 推荐位列表查询指令
参数列表
parameter list
パラメータリスト
path:页面片段路径userId:发布用户idadvanced:开启高级选项, 默认为falsestatus:高级选项:数据状态,【0:操作,1:已发布,2:待审核】disabled:高级选项:禁用状态,默认为falsestartPublishDate:起始发布日期,【2020-01-01 23:59:59】,【2020-01-01】endPublishDate:终止发布日期,高级选项禁用时不能超过现在,【2020-01-01 23:59:59】,【2020-01-01】itemType:数据项类型,【content:内容,category:分类,custom:自定义】itemId:数据项idabsoluteURL:url、封面图处理为绝对路径 默认为truecontainsAttribute:默认为false,http请求时为高级选项,为true时place.attribute为推荐位扩展数据map(字段编码,value)orderField排序字段,【createDate:创建日期,clicks:点击数】,默认发布日期按orderType排序orderType:排序类型,【asc:正序,desc:倒序】,默认为倒序pageIndex:页码pageSize:每页条数
返回结果
return result
戻り値
page:PageHandlerpage.list:List类型 查询结果实体列表CmsPlace
使用示例
usage example
使用例
<@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 CmsPlaceAttributeServiceprotected FileUploadComponentprivate CmsPlaceServiceprivate StatisticsComponent从类继承的字段 com.publiccms.common.base.AbstractTemplateDirective
ADVANCED, APP_TOKEN, AUTH_TOKEN, AUTH_USER_ID, siteComponent从类继承的字段 com.publiccms.common.directive.BaseTemplateDirective
log从接口继承的字段 freemarker.template.TemplateModel
NOTHING -
构造器概要
构造器 -
方法概要
从类继承的方法 com.publiccms.common.base.AbstractTemplateDirective
execute, expose, getAdvanced, getApp, getSite, getUser, getUserId, needUserToken从类继承的方法 com.publiccms.common.directive.BaseTemplateDirective
execute, getName, getNamespace, getShortName, httpEnabled, setName, setNamespace, setShortName
-
字段详细资料
-
service
-
attributeService
-
fileUploadComponent
-
statisticsComponent
-
-
构造器详细资料
-
CmsPlaceListDirective
public CmsPlaceListDirective()
-
-
方法详细资料
-
execute
public void execute(RenderHandler handler) throws IOException, freemarker.template.TemplateException - 参数:
handler-- 抛出:
IOExceptionfreemarker.template.TemplateException
-
supportAdvanced
public boolean supportAdvanced()- 覆盖:
supportAdvanced在类中AbstractTemplateDirective- 返回:
- support advanced parameters
-
needAppToken
public boolean needAppToken()- 覆盖:
needAppToken在类中AbstractTemplateDirective- 返回:
- whether need the app token
-