fastadmin开发手册

文档列表 cms:doclist


{cms:doclist} 标签用于获取和显示文档列表,支持多级嵌套调用。

标签参数


| 参数 | 说明 | 默认值 | 示例 |
|------|------|--------|------|
| 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"}


{/cms:doclist}
``


可用变量


每个文档记录都包含以下变量:

| 变量 | 说明 |
|------|------|
| title | 标题 |
| url | 链接地址 |
| image | 图片 |
| haschild | 是否有子级 |
| is
active | 是否当前文档 |
| level | 层级深度 |
| weigh | 权重/排序 |


10 Screens$8,029

I will design rough sketches for upto 5 Screens of your website/Mobile app.

3 Days Delivery 1 Revision
  • Source File
  • Commercial Use
  • Interactive Mockup
  • 10 Pages

20 Screens$16,029

I will design rough sketches for upto 5 Screens of your website/Mobile app.

3 Days Delivery
  • Source File
  • Commercial Use
  • Interactive Mockup
  • 10 Pages

30 Screens$24,029

I will design rough sketches for upto 5 Screens of your website/Mobile app.

3 Days Delivery
  • Source File
  • Commercial Use
  • Interactive Mockup
  • 10 Pages
0.450313s