Skip to content

Instantly share code, notes, and snippets.

@joekolade
Created April 8, 2023 14:18
Show Gist options
  • 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 {
[email protected] = ${value + ' ' + 'background-image: url(' + imageUri + ');'}
[email protected][email protected] = ${ q(node).property('backgroundimage') == '' ? false : true }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment