Und schon stehe ich vor der nächsten Herausforderung!
Die Ausgabe im Frontend funktioniert jetzt grundsätzlich auch mit Responsive Images vom Bootstrap Package:
<f:render partial="Media/Rendering/Image" arguments="{file: item.image.0, data: data, settings: settings, variants: variants}" />
<picture>
<source data-variant="default" data-maxwidth="1280" media="(min-width: 1400px)" srcset="bild_1.jpg 1x">
<source data-variant="xlarge" data-maxwidth="1100" media="(min-width: 1200px)" srcset="bild_2.jpg 1x">
<source data-variant="large" data-maxwidth="920" media="(min-width: 992px)" srcset="bild_3.jpg 1x">
<source data-variant="medium" data-maxwidth="680" media="(min-width: 768px)" srcset="bild_4.jpg 1x">
<source data-variant="small" data-maxwidth="500" media="(min-width: 576px)" srcset="bild_5.jpg 1x">
<source data-variant="extrasmall" data-maxwidth="374" srcset="bild.jpg 1x">
<img loading="lazy" src="bild.jpg" width="1280" height="961" title="..." alt="...">
</picture>
Es sind zwei CropVariants definiert:
cropVariants:
default:
title: Alle Geräte
allowedAspectRatios:
landscape:
title: 4:3
value: 4 / 3
extrasmall:
title: 'Smartphone'
allowedAspectRatios:
portrait:
title: 2:3
value: 2 / 3
Die Settings vom Bootstrap Package habe ich auch noch referenziert:
lib.contentBlock.settings < lib.contentElement.settings
Einen "Schönheitsfehler" gibt es allerdings doch noch. Bei einer Viewsize von 412 x 915 px wird das Bild mit 1280 x 961 px gerendert.
Suche den Fehler! Ich habe ihn noch nicht gefunden und kann mir das Ergebnis aufgrund des gerenderten HTML-Codes erklären, nicht aber, warum das Rendering die im Content Block festgelegten CropVariants nicht entsprechend berücksichtigt. Ich Backend ist alles ok!
Wer kann mir hier bitte weiterhelfen?