Hi all, Is it possible to apply custom modifiers to collections? Looks like those are all ignored when I tried it out... Or is there a different way that I'm missing?
Alternatively I was thinking to use a ViewModel where I use a query to get the entries, eg.
The entries have a radio fieldtype and depending on the selection additional fieldtypes.
Collection::find('myCollection')
->queryEntries()
->where('published', true)
->orderBy('from', 'asc') // initial order by common field
->get();
Then do some stuff with those entries, re-ordering depending on the additional fieldtypes and so on... finally I have an array that could look something like this one:
$newArray = [
'optionX' => [ ... entries ordered by x ...],
'optionY' => [ ... entries ordered by y ...],
'optionZ' => [ ... entries ordered by z...]
];
Now, how to convert the $newArray
and pass it back to the view?
return [
'newArray' => $newArray // augment/cascade? new array so it works the usual way in template?
]
Any suggestions are much appreciated : ) Thanks