Multiple page types displayed on page list block

Permalink
Hello,

I have a problem I am facing. I have a Page list displaying page types "events". Now I want to be displaying multiple page types in the same page list. The problem I have is that this page types are all stored in different locations in sitemap (individual folders events, news, publications).
Now I want to display all page types event and page types news&publications if they have a set date.
So far I came up with 2 solutions.
First one is moving all 3 folders under another parent folder and then displaying that parent folder on page list.
And second one displaying all page types but the filter page types displayed in page list view.
But problem I am facing with both solutions is pagination. Just filtering by page type in view still effects paggination and I and up with empty pagination pages. So has anyone have a solution with this kind of problem and can point me in the right direction? Also is there another way of displaying multiple page types. And where can I specify filter which pages to be displayed in page list so it does not effect pagination.

Thank you for all your help!!

 
Gondwana replied on at Permalink Reply
Gondwana
In code (obviously), you could subclass PageList and write your own query. See
https://documentation.concrete5.org/developers/working-with-pages/se...

You may also need to clone and modify the Page List block to call the relevant method in your PageList subclass.
korxz replied on at Permalink Reply
I should use filter in view? I tried using it, it filters like it should (question here can it also filter by attributes such as date? Becasuse filterByEventDate returns a empty object even if event_date attribute is set). But I'm still have the same problem with pagination.
korxz replied on at Permalink Reply
OK I sorted my problem out, I applyed 2 filters in the view.
$list->filterByPageTypeHandle(['article', 'event', 'note']);
   $list->filterByAttribute('event_date', date('Y-m-d H:i:s', 0), '>');


Did the same thing for pagination and worked there also.