Is it possible to sort bij Multiple TV’s?
I’m making a site for a client who currently offers 3 different workshops. Each workshop is given 3 times a year. So I have 9 dates a year for now.
For the ‘productpage’ I’ve made 3 TV’s (*date1, *date2, *date3)
For the workshops I’m using an Collection.
So far so good.
I want to make a calendar and sort the 9 workshops (3 x 3) by date. So the calendar is filled automatically by using the tv’s on the product-page.
I don’t know if it’s even possible.
So far, it is sorted by product and then by date.
Is there a solution?
So how exactly should the output look like?
The earliest date is listed first (regardless if it is in TV “data1”, “data2” or “data3”) and the same workshop appears 3 times in the list?
exactly. That’s what I want. First upcoming workshop is the first in the list, regardless which workshop it is.
For Example:
10 march 2025- Workshop A
14 march 2025 - Workshop C
15 march 2025 - Workshop A
17 march 2025 - Workshop B
I don’t think this is possible with a single call to pdoResources.
I guess you have to do some custom coding for this.
You could call pdoResources in a custom snippet with $modx->runSnippet()
and “data” as the return type
$resource_data = $modx->runSnippet("pdoResources", [
...
"return" => "data"
]);
and then do the sorting yourself in PHP.
Thank you. Thought so. I’ll give it a shot but I’m not very familiar with php