# Confluence 子页面显示（Children Display）宏

**URL:** <https://www.isharkfly.com/t/confluence-children-display/6033>\
**Category:** 文档交付\
**Tags:** confluence\
**Created:** [February 11, 2014, 5:36am UTC](https://www.isharkfly.com/t/confluence-children-display/6033 "2014-02-11T05:36:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [February 11, 2014, 5:36am UTC](https://www.isharkfly.com/t/confluence-children-display/6033/1 "2014-02-11T05:36:42Z")

</div>

使用子页面显示宏可以在页面中列出所有的子页面列表和子页面中的子页面列表。换句话说可以在这里进行列表的多层显示。

在默认情况下，子页面显示宏将子页面显示为链接，显示的结果如下图所示。

当用户对页面进行访问的时候，用户将会看到具有查看权限的页面。例如，某个页面对访问的用户来说，不具有访问权限，那么在子页面列表中是不会显示的。

屏幕截图：Confluence 的子页面显示（Children Display ）宏

参数  
宏参数的定义为，你可以使用这些参数在宏输出的内容和格式上进行定义。

Confluence 使用的存储格式或者 wikimarkup 格式中使用的参数和在宏浏览器中使用的标签是不同的，这些将会在下面在括号内容中列出(example)。  
[color=rgb(51, 51, 51)][table]  
[tr][td][align=left]参数[/align]  
[/td][td][align=left]默认值[/align]  
[/td][td][align=left]说明[/align]  
[/td][/tr]  
[tr][td]显示所有子页面（Show Descendants）（all）  
   
[/td][td]false  
[/td][td]选择是否显示所有页面中的子页面。  
[align=left]如果将这里把值设置为： true 那么将会在这里显示完整的页面树结构。如果你有设置参数 下级页面深度（Depth of Descendants）将不会产生作用。[/align][/td][/tr]  
[tr][td]上级页面（Parent Page）（page）  
   
[/td][td]current  
[/td][td]指定需要显示子页面的页面，你可以是当前页面，也可以是其他页面。输入：  
[list]  
[_]‘/’ — 列出当前空间中的最顶层的页面。这些页面一级没有上级页面了。  
[_]‘pagename’ — 需要对子页面进行列表的特定页面。  
[_]‘spacekey:’ — 列出指定空间的顶级页面。  
[_]‘[color=#3b73af][spacekey:pagename](http://spacekeypagename/)[/color]’ — 列出指定空间中的指定页面，这个宏需要显示这个页面的子页面。  
[/list][/td][/tr]  
[tr][td]子页面数量（Number of Children）（first）  
[/td][td]none  
[/td][td]设置需要显示子页面的数量。  
[/td][/tr]  
[tr][td]下级页面深度（Depth of Descendants）（depth）  
[/td][td]none  
[/td][td]输入数字来确定页面的显示深度。例如，如果这个值为 2，那么这个宏将会显示 2 层子页面。  
[align=left]当你设置了参数 显示所有子页面（Show Descendants ）后，这个参数就失效了。[/align][/td][/tr]  
[tr][td]标题样式（Heading Style）(style)  
[/td][td]none  
[/td][td]选择用于显示子页面的样式。  
[/td][/tr]  
[tr][td]包含摘要（Include Excerpts）(excerpt)  
[/td][td]false  
[/td][td]如果子页面中有摘要的话，那么连同摘要一同显示。  
[/td][/tr]  
[tr][td]子页面按什么排序（Sort Children By）(sort)  
[/td][td]如果你指定了这个参数，那么将会按照你指定的参数排序。  
[align=left]否则默认情况下按照字母顺序排序。[/align][/td][td]可选的：  
[list]  
[\*]creation — 按照页面创建日期排序。  
[\*]title — 按照标题字母排序。  
[\*]modified — 按照页面的最后更新日期排序。  
[/list][/td][/tr]  
[tr][td]反向排序（Reverse Sort）(reverse)  
[/td][td]false  
[/td][td]需要和 子页面按什么排序（Sort Children By）参数一同使用。  
[align=left]如果设置了这个参数，那么页面的排序方式将会有升序变成降序。[/align]  
[/td][/tr]  
[/table][/color]

下面的代码是提供给希望进一步编辑 Confluence 页面的高级用户使用的。

宏名称：children  
宏内容： None

存储格式示例`<ac:structured-macro ac:name="children">
  <ac:parameter ac:name="reverse">true</ac:parameter>
  <ac:parameter ac:name="sort">creation</ac:parameter>
  <ac:parameter ac:name="style">h4</ac:parameter>
  <ac:parameter ac:name="page">
    <ac:link>
      <ri:page ri:content-title="Home"/>
    </ac:link>
  </ac:parameter>
  <ac:parameter ac:name="excerpt">true</ac:parameter>
  <ac:parameter ac:name="first">99</ac:parameter>
  <ac:parameter ac:name="depth">2</ac:parameter>
  <ac:parameter ac:name="all">true</ac:parameter>
</ac:structured-macro>`Wiki 标记示例`{children:reverse=true|sort=creation|style=h4|page=Home|excerpt=true|first=99|depth=2|all=true}`来源：[http://cwiki.ossez.com/pages/viewpage.action?pageId=2393231](http://cwiki.ossez.com/pages/viewpage.action?pageId=2393231)
