This setup works fine. But now I would like to use the new notation
// A shared footer which can be edited from all pages
// You need to define this for every page type
prototype(Vendor.Site:Document.Page) {
body {
# we define a new property where we render the footer
footer = Neos.Neos:ContentComponent {
# set the correct node for inline editing on subpages
@context.node = ${site}
# get all items from the root node footer
collection = ${q(site).children('footer').children()}
}
# we append the footer as part of the body content
# this might change depending on what/how you render the body content
body.@process.appendFooter = ${value + this.footer}
}
}
I don’t know, how it is correctly to build it in my project.
My Page.fusion starts with:
Why not define footer = V.S:Document.Fragment.Content.Footer in V.S:Document.Page that way all document types that are derived from that should inherit the editable footer.
body = V.S:Component.Template.Default {
@context.node = ${this.node}
.......
content = Neos.Fusion:Component {
main = Neos.Neos:PrimaryContent {
nodePath = 'main'
}
footer = V.S:Document.Fragment.Content.Footer
renderer = afx`
{props.main}
{props.footer}
`
}
.......
}
Now I see, footer is included on content.
I changed it to:
body = V.S:Component.Template.Default {
@context.node = ${this.node}
.......
footer = Neos.Neos:ContentComponent {
# set the correct node for inline editing on subpages
@context.node = ${site}
# get all items from the root node footer
collection = ${q(site).children('footer').children()}
}
# we append the footer as part of the body content
# this might change depending on what/how you render the body content
body.@process.appendFooter = ${value + this.footer}
content = Neos.Fusion:Component {
main = Neos.Neos:PrimaryContent {
nodePath = 'main'
}
renderer = afx`
{props.main}
{props.footer}
`
}
.......
}
At the moment, I get the error:
# An exception was thrown while Neos tried to render your page
No Fusion object found in path "root<Neos.Fusion:Case>
/documentType<Neos.Fusion:Matcher>
/element<V.S:Document.Page>
/body<V.S:Component.Template.Default>
/footer<Neos.Neos:ContentComponent>/renderer"
Please make sure to define one in your Fusion configuration.
root<Neos.Fusion:Case>/
documentType<Neos.Fusion:Matcher>/
element<V.S:Document.Page>/
body<V.S:Component.Template.Default>/
footer<Neos.Neos:ContentComponent>/
// A shared footer which can be edited from all pages
// You need to define this for every page type
prototype(Vendor.Site:Document.Page) {
body {
# we define a new property where we render the footer
footer = Neos.Neos:ContentComponent {
# set the correct node for inline editing on subpages
@context.node = ${site}
# get all items from the root node footer
collection = ${q(site).children('footer').children()}
}
# we append the footer as part of the body content
# this might change depending on what/how you render the body content
body.@process.appendFooter = ${value + this.footer}
}
}
Can this be right? One line collection Where is the loop? Isn’t it collection part of Neos.Fusion:Collection and Neos.Neos:ContentCollection ?
prototype(A.S:Document.Page) {
body {
# we define a new property where we render the footer
footercontent = Neos.Neos:ContentComponent {
# get all items from the root node footer
footer = Neos.Neos:ContentCollection {
nodePath = ${q(site).children('footer').property('_path')}
collection = ${q(site).children('footer').children()}
}
renderer = afx`
{props.footer}
`
}
}
# we append the footer as part of the body content
# this might change depending on what/how you render the body content
body.@process.appendFooter = ${value + this.footercontent}
}
It would be very kind, if Roland Schütz could correct that in the tutorial.