From 558f2d30b5340fcceb707e5c92e552da9423af13 Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Fri, 11 Aug 2023 11:11:35 +0200 Subject: [PATCH] BUGFIX: Make it possible to properly align images again No float this time --- .../Fusion/Content/SemanticSection.fusion | 2 +- .../Private/Fusion/Overrides/Image.fusion | 54 ++++++++++++------- .../Fusion/Overrides/TextWithImage.fusion | 3 +- .../Private/Scss/Atoms/_Typography.scss | 6 ++- .../Resources/Private/Scss/Main.scss | 1 + .../Private/Scss/Molecules/_Image.scss | 23 ++++---- .../Scss/Molecules/_SemanticSection.scss | 7 +++ 7 files changed, 66 insertions(+), 30 deletions(-) create mode 100644 DistributionPackages/Neos.NeosIo/Resources/Private/Scss/Molecules/_SemanticSection.scss diff --git a/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Content/SemanticSection.fusion b/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Content/SemanticSection.fusion index 786e76247..c3734b91b 100644 --- a/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Content/SemanticSection.fusion +++ b/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Content/SemanticSection.fusion @@ -2,7 +2,7 @@ prototype(Neos.NeosIo:SemanticSection) < prototype(Neos.Neos:ContentComponent) { isLast = ${iterator.isLast} renderer = afx` -
+

diff --git a/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Overrides/Image.fusion b/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Overrides/Image.fusion index ab32e3d17..bfd4b2021 100644 --- a/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Overrides/Image.fusion +++ b/DistributionPackages/Neos.NeosIo/Resources/Private/Fusion/Overrides/Image.fusion @@ -12,7 +12,9 @@ prototype(Neos.NodeTypes:Image) < prototype(Neos.Neos:ContentComponent) { } image = ${q(node).property('image')} - imageClassName = Neos.Fusion:DataStructure { + className = Neos.Fusion:DataStructure { + main = 'neos-nodetypes-image' + alignment = ${'neos-alignment-' + q(node).property('alignment')} alignment.@if.isSet = ${q(node).property('alignment')} @@ -54,22 +56,38 @@ prototype(Neos.NodeTypes:Image) < prototype(Neos.Neos:ContentComponent) { renderer.@context.image = Neos.Fusion:Case { default { condition = ${props.image} - renderer = Neos.Neos:ImageTag { - asset = ${props.image} - title = ${props.title} - maximumHeight = ${props.maximumHeight} - maximumWidth = ${props.maximumWidth} - allowUpScaling = ${props.allowUpScaling} - allowCropping = ${props.allowCropping} - width = ${props.width} - height = ${props.height} - async = true - attributes.alt = ${props.alternativeText} - attributes.loading = ${props.loading} - attributes.style = Neos.Fusion:Join { - maxHeight = ${'max-height: ' + props.maximumHeight + 'px;'} - maxHeight.@if.set = ${props.maximumHeight} + renderer = Neos.Fusion:Component { + @apply.props = ${props} + + thumbnail = ${Neos.Seo.Image.createThumbnail( + props.image, + null, + props.width, + props.maximumWidth, + props.height, + props.maximumHeight, + props.allowCropping, + props.allowUpScaling, + true + )} + + renderer.@process.debug = Neos.Fusion:Debug.Console { + value = ${props} } + + renderer = afx` + {props.alternativeText} + + + ` } } fallback { @@ -87,8 +105,8 @@ prototype(Neos.NodeTypes:Image) < prototype(Neos.Neos:ContentComponent) { } renderer = afx` -