Skip to content

Commit

Permalink
neos#517 add possibility to make keyvisual smaller, e.g. for service …
Browse files Browse the repository at this point in the history
…provider listing
  • Loading branch information
schneider.n committed Sep 8, 2023
1 parent bcfba54 commit e24e906
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
prototype(Neos.NeosIo.ServiceOfferings:Document.ServiceProviderCollection) < prototype(Neos.NeosIo:DefaultPage) {
body {
content {
keyVisual = Neos.NeosIo:KeyVisual {
keyVisualSize = 'small'
}

main = Neos.Fusion:Join {
top = Neos.Neos:PrimaryContent {
nodePath = 'main'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ prototype(Neos.NeosIo:KeyVisual) < prototype(Neos.Fusion:Component) {
// API
keyVisualImage = null
keyVisualImageSmall = null
keyVisualSize = 'default'
isKeyVisualContentsInverted = false
content = null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ prototype(Neos.NeosIo:KeyVisual.AbstractRenderer) < prototype(Neos.Fusion:Compon
highQualityImageUri = ''
imageSrcSet = ''

classes = "keyVisual print-hidden"
classes = ${"keyVisual keyVisual--" + props.keyVisualSize + " print-hidden"}

divClasses = ${"keyVisual__contents u-alignCenter " + (this.isKeyVisualContentsInverted ? "u-invertText" : "")}
previewImageStyleAttribute = ${"background-image: url('" + this.previewImageUri + "')"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ prototype(Neos.NeosIo:KeyVisual.StaticPlaceholderImageRenderer) < prototype(Neos
highRes = ${staticUrlPrefix + "-1280w.jpg 1280w, "}
mediumRes = ${staticUrlPrefix + "-658w.jpg 658w"}
}

keyVisualSize = ${props.keyVisualSize}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
overflow: hidden;
background: #000;

&--small {
.keyVisual__contents {
height: MIN(250px, 25vw);
}
}

&:before {
content: '';
position: absolute;
Expand Down

0 comments on commit e24e906

Please sign in to comment.