I composed the below Fusion object. As marked in the snippet, I can only pass the array to another Fusion object (CategoryReduce) by define the EEL array literal. Any idea how can I pass the property instead please?
prototype(MyOrq:Site.Molecule.CategoryLinks) < prototype(Neos.Fusion:Component) {
# articles from Caller object
tempArr = ${['javaa', 'phpe', 'javaa']}
categories = MyOrq:Site.Atom.CategoryReduce
categories.@context.arr = ${['javaa', 'phpe', 'javaa']} //**** This works
// categories.@context.arr = ${this.tempArr} // ****** The array is not passed to MyOrq:Site.Atom.CategoryReduce
fCats = ${Array.map(this.categories, (v, k) => k + ' (' + v + ')')}
renderer = afx`
<ul>
<Neos.Fusion:Loop items={props.fCats}>
<li>{item}</li>
</Neos.Fusion:Loop>
</ul>
`
}
Could you provide some more context on what you are trying to achieve with the given code? To me, it somehow looks overly complex, but since I don’t know the goal, it’s hard to provide support.
Just as a side note, if you code in a team (or can resonably assume that your code will one be read by others), try using variable/property names that are meaningful. fCats → filteredCategories?
Apart from that, using @context can sometimes (not in this case) have unwanted side effects. So for documentation purposes, here is a variant of your code using Fusion @process to transform your incoming data to the aggregation you need for looping. This is possible because the (incoming) value of a processor is passed through the context.