类 CmsPlaceListDirective

所有已实现的接口:
Directive, HttpDirective, freemarker.template.TemplateDirectiveModel, freemarker.template.TemplateModel

@Component public class CmsPlaceListDirective extends AbstractTemplateDirective
placeList 推荐位列表查询指令

参数列表

parameter list

パラメータリスト

  • 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:每页条数

返回结果

return result

戻り値

使用示例

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>