feat: add image gallery content element with configurable columns and backend preview
All checks were successful
Build / build (push) Successful in 4m21s
Build / deploy-stage (push) Successful in 2m41s
Build / switch-stage (push) Successful in 2m4s

This commit is contained in:
2025-06-16 13:50:41 +02:00
parent c4d01f2a47
commit 37300492dc
5 changed files with 155 additions and 1 deletions

View File

@@ -0,0 +1,39 @@
<html
xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"
data-namespace-typo3-fluid="true"
>
<f:layout name="Preview"/>
<f:section name="Header">
<be:link.editRecord uid="{data.uid}" table="{data.mainType}">
<f:if condition="{data.header}">
<f:then><strong>{data.header}</strong></f:then>
</f:if>
</be:link.editRecord>
</f:section>
<f:section name="Content">
<f:if condition="{data.image}">
<div class="row">
<f:for each="{data.image}" as="image" iteration="iterator">
<f:if condition="{iterator.index} < 3">
<div class="col-4">
<f:image image="{image}" width="100" height="auto" treatIdAsReference="1" alt="Preview image" />
</div>
</f:if>
</f:for>
</div>
<f:if condition="{data.image -> f:count()} > 3">
<p>+ {f:math.subtract(a: '{data.image -> f:count()}', b: '3')} more images</p>
</f:if>
<p>
<f:switch expression="{data.columns}">
<f:case value="2">2 Columns</f:case>
<f:case value="3">3 Columns</f:case>
<f:case value="5">5 Columns</f:case>
<f:defaultCase>1 Column</f:defaultCase>
</f:switch>
</p>
</f:if>
</f:section>
</html>