@Component public class CmsCategoryListDirective extends AbstractTemplateDirective
参数列表
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
:每页条数
返回结果
page
:PageHandler
page.list
:List类型 查询结果实体列表,顺序排序正序,id倒序
CmsCategory
<@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>
限定符和类型 | 字段和说明 |
---|---|
private CmsCategoryAttributeService |
attributeService |
private CmsCategoryService |
service |
ADVANCED, AUTH_TOKEN, AUTH_USER_ID, siteComponent
log
构造器和说明 |
---|
CmsCategoryListDirective() |
限定符和类型 | 方法和说明 |
---|---|
void |
execute(RenderHandler handler) |
boolean |
supportAdvanced() |
execute, expose, getAdvanced, getApp, getSite, getUserId, needAppToken, needUserToken
execute, getName, getNamespace, getShortName, httpEnabled, setName, setNamespace, setShortName
private CmsCategoryService service
private CmsCategoryAttributeService attributeService
public void execute(RenderHandler handler) throws java.io.IOException, freemarker.template.TemplateException
java.io.IOException
freemarker.template.TemplateException
public boolean supportAdvanced()
supportAdvanced
在类中 AbstractTemplateDirective