类 CmsCategoryListDirective

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

@Component public class CmsCategoryListDirective extends AbstractTemplateDirective
categoryList 分类列表查询指令

参数列表

parameter list

パラメータリスト

  • parentId:父分类id
  • typeId:分类类型id
  • absoluteURL:url处理为绝对路径, 默认为 true
  • queryAll:查询全部,【true,false】,parentId为空时有效
  • advanced:开启高级选项, 默认为false
  • containsAttribute默认为true,http请求时为高级选项,为true时category.attribute为分类扩展数据map(字段编码,value)
  • disabled:高级选项:禁用状态, 默认为false
  • hidden:高级选项:隐藏,【true,false】
  • pageIndex:页码
  • pageSize:每页条数

返回结果

return result

戻り値

使用示例

usage example

使用例

<@cms.categoryList pageSize=10><#list page.list as a>${a.name}<#sep>,</#list></@cms.categoryList>

   <script>
    $.getJSON('${site.dynamicPath}api/directive/cms/categoryList?pageSize=10', function(data){
      console.log(data.page.totalCount);
    });
    </script>