我如何访问 Apostrophe CMS 上页面的子页面小部件

How i can access to children pages widgets of a page on Apostrophe CMS

我的一个项目页面上有以下代码:

{% if data.page %}
    <ul>
    {%for child in data.page._children %}
    <li><a href="{{ child._url}}"></a>{{child.title}}
    <p>{{ apos.area(child, 'excerpt', 
            { widgets: 
                { 'apostrophe-rich-text': 
                    {
                    toolbar: [ 
                       'Styles', 
                       'Bold', 
                       'Italic', 
                       'Link',
                       'Unlink'] 
                    }
                }
            })
        }}
    </p>
    </li>
  {% endfor %}
  </ul>
{% endif %}

其中'excerpt'是当前页面所有子页面上的一个区域,但是当页面显示时我只看到一个空框: empty box

我在文档上看到了一些类似的东西 how to: children and joins,但我不确定将示例代码放在哪里才能正常工作(也许文档不够清楚)。

请多多指教,谢谢

There is now an official HOWTO answering this question on the Apostrophe documentation site. 简而言之,答案是您必须配置 apostrophe-pages 以加载更多有关相关页面的基本信息。当然,存在性能折衷,但您可以通过指示 Apostrophe 仅加载您为此目的使用的单例或区域名称的图像来限制这一点。