fastadmin开发手册

父级文档功能

功能说明


postparent 用于实现文档的父子关系,可以通过 postparent 字段获取父级文档的信息。

数据结构


在 archives 表中:
- postparent: 父级文档ID
- 当 post
parent = 0 时表示顶级文档
- 当 post_parent > 0 时表示该文档有父级文档

标签使用


``html

{cms:archives name="postparent" /}


{cms:archives name="post
parent|getUrl" /}


{cms:archives name="postparent|getTitle" /}


{cms:arclist id="item" post
parent="ARCHIVES.id"}

{$item.title}

{/cms:arclist}
``


使用示例


``html

{if $ARCHIVES.postparent}

{/if}


{cms:arclist id="child" post
parent="ARCHIVES.id" orderby="weigh" orderway="asc"}


{/cms:arclist}


{cms:arclist id="level1" postparent="0"}


{$level1.title}


{cms:arclist id="level2" post
parent="level1.id"}

{$level2.title}



{/cms:arclist}

{/cms:arclist}
``


注意事项


1. post_parent 值必须是已存在的文档ID
2. 避免出现循环引用(A的父级是B,B的父级是A)
3. 建议控制层级深度,一般不超过3层
4. 修改父级时注意更新相关的导航和面包屑

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.345771s