我在撇号中做了一个导航栏,每个新页面都创建了要求图像的图像,图像是图像小部件的单例,这是字段:
{
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 -%}
但它不起作用