Skip to content

Instantly share code, notes, and snippets.

@svparijs
Created May 15, 2019 17:23
Show Gist options
  • Save svparijs/32e0b865da91b2317e8163ad01cd9043 to your computer and use it in GitHub Desktop.
Save svparijs/32e0b865da91b2317e8163ad01cd9043 to your computer and use it in GitHub Desktop.
Prevent divs wrapping for contentcollections / change their css classes
page = Page {
body {
// These are your content areas, you can define as many as you want, just name them and the nodePath.
content {
// The default content section
main = PrimaryContent {
nodePath = 'main'
}
// A footer ContentCollection
footer = ContentCollection {
nodePath = 'footer'
// prevent adding default css class .neos-contentcollection
attributes.class.@process.collectionClass >
// add custom css classes
attributes.class = 'ui fluid container'
}
}
}
}
prototype(Neos.Neos:PrimaryContent) {
default.renderer {
attributes.class = 'main-content'
attributes.class.@process.collectionClass >
}
}
prototype(Neos.Neos:PrimaryContent) {
// add a new case definition for your page
mypage {
condition = ${q(node).is('[instanceof My.Package:MyPage]')}
renderer = Neos.Neos:ContentCollection {
nodePath = ${nodePath}
attributes.class = 'my-css another-class'
attributes.class.@process.collectionClass >
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment