I have a group, which can contain different types of Accordion-NodeTypes. I want to make the accordion (HTML Details) “exclusive” by setting the name attribute.
prototype(My.Site:Content.AccordionGroup) < prototype(Neos.Neos:ContentComponent) {
@context.accordionGroupName = ${node.aggregateId}
accordions = Neos.Fusion:Loop {
items = ${q(node).children().get()}
itemRenderer = Neos.Neos:ContentCase {
@context.node = ${item}
}
}
renderer = afx`
<div class="accordion-group">
{props.accordions}
</div>
`
}
Example of an Accordion-NodeType:
prototype(My.Site:Content.Accordion) < prototype(Neos.Neos:ContentComponent) {
accordionGroupName = ${q(node).property('accordionGroupName')}
renderer = afx`
<details name={props.accordionGroupName}>
<summary>Accordion Title</summary>
<p>Accordion-Content</p>
</details>
`
}
I couldt set the itemRenderer to My.Site:Content.Accordion and pass the property accordionGroupName here. But that’s not a solution, because I have more than one Accordion-NodeType.