feat: add possibility to change image size at text image element
This commit is contained in:
@@ -1,15 +1,24 @@
|
||||
<f:layout name="Default" />
|
||||
|
||||
<f:section name="Header" />
|
||||
<f:section name="Header"></f:section>
|
||||
<f:section name="Main">
|
||||
<f:asset.css identifier="CBTextImage" href="{cb:assetPath()}/frontend.css" />
|
||||
|
||||
<!-- Determine size class based on imagesize field -->
|
||||
<f:variable name="sizeClass" value="" />
|
||||
<f:if condition="{data.imagesize} == 1">
|
||||
<f:then><f:variable name="sizeClass" value="size-25" /></f:then>
|
||||
</f:if>
|
||||
<f:if condition="{data.imagesize} == 2">
|
||||
<f:then><f:variable name="sizeClass" value="size-50" /></f:then>
|
||||
</f:if>
|
||||
|
||||
<div class="textimage-container image-pos-{data.imageorient}">
|
||||
<div class="textimage-image-wrapper">
|
||||
<div class="textimage-image-wrapper {sizeClass}">
|
||||
<f:if condition="{data.image}">
|
||||
<f:then>
|
||||
<picture>
|
||||
<source
|
||||
<picture class="textimage-picture">
|
||||
<source
|
||||
srcset="
|
||||
{f:uri.image(image:data.image.0, width:'320c', cropVariant:'default')} 320w,
|
||||
{f:uri.image(image:data.image.0, width:'768c', cropVariant:'default')} 768w,
|
||||
@@ -17,13 +26,13 @@
|
||||
sizes="(max-width: 320px) 90vw,
|
||||
(max-width: 768px) 600px,
|
||||
600px" />
|
||||
<f:image
|
||||
image="{data.image.0}"
|
||||
treatIdAsReference="1"
|
||||
cropVariant="default"
|
||||
width="1024c"
|
||||
alt="{data.header}"
|
||||
class="textimage-image" />
|
||||
<f:image
|
||||
image="{data.image.0}"
|
||||
treatIdAsReference="1"
|
||||
cropVariant="default"
|
||||
alt="{data.header}"
|
||||
class="textimage-image"
|
||||
/>
|
||||
</picture>
|
||||
</f:then>
|
||||
<f:else>
|
||||
@@ -34,6 +43,7 @@
|
||||
<div class="textimage-wrapper">
|
||||
<f:if condition="{data.header}">
|
||||
<h2 class="textimage-header">{data.header}</h2>
|
||||
<h3 class="textimage-subheader">{data.subheader}</h3>
|
||||
</f:if>
|
||||
<f:if condition="{data.bodytext}">
|
||||
<div class="textimage-text">
|
||||
|
||||
Reference in New Issue
Block a user