Hey there,
is it possible to filter elements by a specific property which is a reference (type «references»)?
I have the following problem: I’ve created a new node element that should display the latest 5 news (articles). But I don’t know how this works. I can’t find anything in the forum or the documentation. I’ve tried «filter» and «filterByReference» but that’s not working. I got «filterByReference» via Google but I can’t even find it in the Neos / Flow documentation.
prototype(Xyz.Website:News) < prototype(Xyz.Website:Content) {
templatePath = 'resource://Xyz.Website/Private/Templates/NodeTypes/News.html'
headline = ${q(node).property('headline')}
subheadline = ${q(node).property('subheadline')}
tags = ${q(node).property('tags')}
count = ${q(node).property('count')}
newest = ${q(site).find('[instanceof Xyz.Website:Article]').filter('tags', this.tags).sort('date', 'DESC').slice(0, this.count).get()}
}
«tags» is also a property of an «Xyz.Website:Article» and a reference to «Xyz.Website:Tag». An article can have one or more tags.