Skip to content

Instantly share code, notes, and snippets.

@joekolade
Created April 8, 2023 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joekolade/05b975dbe04801bcd049eea687eee5cf to your computer and use it in GitHub Desktop.
Save joekolade/05b975dbe04801bcd049eea687eee5cf to your computer and use it in GitHub Desktop.
[Page background with image]
# NodeTypes.yaml
'Neos.NodeTypes:Page':
properties:
backgroundimage:
type: 'Neos\Media\Domain\Model\ImageInterface'
ui:
label: 'Hintergrund Bild'
inspector:
group: 'document'
editorOptions:
features:
crop: TRUE
resize: TRUE
# Root.fusion
page = Page {
@context.imageUri = Neos.Neos:ImageUri {
asset = ${q(node).property('backgroundimage')}
}
bodyTag {
attributes.style.@process.backgroundImage = ${value + ' ' + 'background-image: url(' + imageUri + ');'}
attributes.style.@process.backgroundImage.@if.backgroundImageIsSet = ${ q(node).property('backgroundimage') == '' ? false : true }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment