Hey everyone. Recently started with Neos and have been loving the process so far.
I came across one use case I can’t seem to solve.
We have the following NodeType which should provide a Tag to all Nodes that inherit it. These children should then use the , add to it and fill it with their own content i.e. columns:
Im not sure how to load what ColOne is rendering inside SectionComponent, especially ColOne’s properties.
My goal is:
SectionComponent will have every property I need across multiple Components. So that changing or adding a property does not require me to change every child component but only the parent instead. But more than a few components need either specific section IDs or other attributes to work in addition to what the parent provides. And each component, of course, has it’s own HTML.
Any tips on what I’m doing wrong or how to approach this would be greatly appreciated.
When you want to use the more JavaScript JSX like way of wrapping things you need to use {props.content} (this will hold the children) instead of {value}:
(i also made yout attributes.id thingy work ;))
prototype(Site.Site:Component.ColOne) < prototype(Neos.Fusion:Component) {
someHeadline = "hello"
renderer = afx`
<Site.Site:Component.SectionComponent attributes.id='someId'>
<!-- AFX will put the children into the 'content' path by default -->
<div class="stuff">content: {props.someHeadline}</div>
</Site.Site:Component.SectionComponent>
`
}
prototype(Site.Site:Component.SectionComponent) < prototype(Neos.Neos:ContentComponent) {
attributes = Neos.Fusion:DataStructure
attributes {
data-first = ''
data-second = ''
}
content = ''
renderer = afx`
wrapper start
<Neos.Fusion:Tag tagName="section" attributes={props.attributes}>
{props.content}
</Neos.Fusion:Tag>
wrapper end
`
}