也许有人需要使用当前版本的flux(7.4.0)解决方案:
将后端字段制作出来:
<flux:field.inline.fal name="bild" showThumbs="true" allowedExtensions="'gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai,svg'" maxItems="1" required="true" />
调用图片:
{v:content.resources.fal(field: 'bild') -> v:iterator.first() -> v:variable.set(name: 'bild')}
<f:image treatIdAsReference="1" src="{bild.id}" title="{bild.title}" alt="{bild.alternative}" maxWidth="80" maxHeight="50" crop="{bild.crop}"/>
我的内容元素的完整代码:
<f:layout name="Content"/>
<f:section name="Configuration">
<flux:form id="footerbild" options="{group: 'FeWo-Seiteninhalte'}">
<flux:field.inline.fal name="bild" showThumbs="true" allowedExtensions="'gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai,svg'" maxItems="1" required="true" />
</flux:form>
</f:section>
<f:section name="Preview">
{v:content.resources.fal(field: 'bild') -> v:iterator.first() -> v:variable.set(name: 'bild')}
<f:image treatIdAsReference="1" src="{bild.id}" title="{bild.title}" alt="{bild.alternative}" maxWidth="80" maxHeight="50" crop="{bild.crop}"/>
</f:section>
<f:section name="Main">
{v:content.resources.fal(field: 'bild') -> v:iterator.first() -> v:variable.set(name: 'bild')}
<f:image class="img-responsive" treatIdAsReference="1" src="{bild.id}" title="{bild.title}" alt="{bild.alternative}" crop="{bild.crop}"/>
</f:section>
在预览中,此操作将执行以下操作:
预览
而在后端插件中,则会执行以下操作:
插件视图
它支持图片上传、内置编辑器的图片剪裁等功能。
<flux:field.inline.fal>
。 - yunzen