如何在撇号cms中提取子页面的图像

how to extract image of a child page in apostrophe cms

我在创建的每个新页面中都在撇号中做一个导航栏请求要求图像的图标是图像小部件的单例这是该字段:

{
  name: 'icon',
  label: 'Icon',
  type: 'singleton',
  widgetType: 'apostrophe-images',
  options: {
             limit: 1,
             minSize: [200,200],
             aspectRatio: [1,1]
           }
}

当我想将它引入我的通用模板时,我正在尝试这样做:

{%- for tab in data.home._children -%}
  {%- set image = tab.icon or tab -%}
    <li>
      <a class="sidebar-main-link" href="{{ tab._url }}">
        <img class = "icon" src = "{{apos.attachments.url (image.attachment, {size: 'full'})}}" /> 
          {{tab.title}}
      </a>
     </ li>
{%- endfor -%}

但是没用

There is a new tutorial on the Apostrophe site covering this question in detail. Also see the .