1. 模板标签
标签 | #categoryList() |
---|---|
用途 | 栏目列表 |
参数 | 参数为一个map,以kv对的形式 |
返回 | 返回 list |
2. 参数说明
#articleDetail({
parentId:1,
withChild:true,
orderBy:'id|sort',
orderSort:'desc|asc'
})
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
parentId | int | 否,默认为0,即根栏目 | 父栏目的id |
withChild | bool | 否,默认为true, | 是否迭代查子栏目 |
orderBy | str | 否,,默认id | 排序字段 |
orderSort | str | 否,默认为desc | 排序 |
3. 实例
-
1.获取一级栏目
#categoryUrl()
<a href="#(item.categoryUrl)">
#(item.categoryName)
a>
#end
-
2.获取所有栏目
#categoryUrl({withChild:true}})
<a href="#(item.categoryUrl)">
#(item.categoryName)
a>
#end