标签参数
| 参数 | 说明 | 默认值 | 示例 |
|------|------|--------|------|
| id | 循环变量名 | - | id="doc" |
| type | 获取类型 | - | type="top/son/sons" |
| channel | 频道ID | - | channel="27" |
| typeid | 父级ID | 0 | typeid="doc.id" |
| orderby | 排序字段 | weigh | orderby="weigh" |
| orderway | 排序方式 | asc | orderway="asc" |
| limit | 显示数量 | 10 | limit="20" |
| haschild | 是否只显示有子级的 | false | haschild="true" |
| condition | 自定义条件 | - | condition="status='normal'" |
type参数说明
- top: 获取顶级文档
- son: 获取直接子级文档
- sons: 获取所有子级文档
调用示例
``
html
{cms:doclist id="doc"}
{$doc.title}
{/cms:doclist}
{cms:doclist id="doc" condition="status='normal'" orderby="weigh" orderway="asc"}
{$doc.title}
{/cms:doclist}
{cms:doclist id="doc" haschild="true"}
{$doc.title}
{/cms:doclist}
``多级调用示例
``
html
{cms:doclist id="level1" type="top"}
{$level1.title}
{cms:doclist id="level2" type="son" typeid="level1.id"}
{$level2.title}
{/cms:doclist}
{/cms:doclist}
{cms:doclist id="level1" type="top" orderby="weigh" orderway="asc"}
{if $level1.haschild}
{cms:doclist id="level2" type="son" typeid="level1.id" orderby="weigh" orderway="asc"}
{/cms:doclist}
{/if}
{/cms:doclist}
``可用变量
每个文档记录都包含以下变量:
| 变量 | 说明 |
|------|------|
| title | 标题 |
| url | 链接地址 |
| image | 图片 |
| haschild | 是否有子级 |
| isactive | 是否当前文档 |
| level | 层级深度 |
| weigh | 权重/排序 |

