图像的所有可能尺寸是多少?
本质上,我如何获得已“附加”到页面的图像列表?我正在尝试创建自己的图片库,因为默认图库是有限的。这是否意味着我应该创建自己的小部件来扩展“撇号图像小部件”?
因此,一旦我这样做,并将小部件添加到页面并添加图像,我如何获取图像列表?我想获得缩略图大小,以及要放置在模态中的更大尺寸的图像?所有可能的尺寸有哪些?
下面是显示 Apostrophe 附带的默认图片库的代码:
{%- for entry in data.widget._pieces -%}
{%- set image = entry.item or entry -%}
{%- set relationship = entry.relationship -%}
<div data-slideshow-item class="apos-slideshow-item{% if loop.first %} apos-current{% endif %}{% block itemClass %}{% endblock %}" style="background-image: url({{ apos.attachments.url(image.attachment, { size: data.options.size, crop: relationship }) }})">
{%- block title -%}
<h4>{{ image.title }}</h4>
{%- endblock -%}
<img data-image src="{% block imgSrc %}{{ apos.attachments.url(image.attachment, { size: data.options.size, crop: relationship }) }}{% endblock %}"/>
{%- endfor -%}
这是撇号资产的文档:http: //apostrophecms.org/docs/modules/apostrophe-assets/index.html
该文档记录了一些可能的尺寸,但感觉不完整。我没有关注如何为单个资产的多种尺寸请求多个 URL。