Hello there,
I’m new to neos and unable to load a child node of my node. In this case, the child node is a Neos.Neos:ContentCollection. In the final component where I want to display the collection, it’s not available.
Where I’m currently at:
I have a Document Node called Event. The event node has a childNode which is called main and type ContentCollection.
'Page.Site:Document.Event':
superTypes:
'Neos.Neos:Document': true
'Neos.Neos:Content': true
'Page.Site:Mixin.InspectorGeneral': true
'Page.Site:Mixin.Image': true
ui:
label: 'Event'
group: event
icon: 'file-alt'
inspector:
groups:
page:
label: 'Event'
moreinfo:
label: 'More Info'
childNodes:
'main':
type: 'Neos.Neos:ContentCollection'
properties:
..........
To display a list of my events, I have a Content Element which loads the Events.
In the content element I loop with a Fusion Loop through the list and pass the event to a EventItem Component.
prototype(Page.Site:Content.EventList) < prototype(Neos.Neos:ContentComponent) {
events = ${q(site).find('[instanceof Page.Site:Document.Event]')}
renderer = afx`
<div class="events">
<Neos.Fusion:Loop items={props.events} itemName="event" iterationName="itemIterator">
<Page.Site:Content.EventItem event={event}></Page.Site:Content.EventItem>
</Neos.Fusion:Loop>
</div>
`
}
In the EventItem component I try to get the ContentCollection from the event node. But there is the problem. I can’t.
prototype(Page.Site:Content.EventItem) < prototype(Neos.Neos:ContentComponent) {
myContent = Neos.Neos:ContentCollection {
nodePath = ${q(node).property('event').children('[instanceof Neos.Neos:ContentCollection]').get(0).path}
}
renderer = afx`
<div>
{ props.myContent }
</div>
`
}
What am I missing here?