Multiple Page Type filters within a Page List block
Permalink
Hi all,
I've run into a challenge where by I could do with creating a page list block that filters not just by one Page Type but rather two, so that the resultant list of pages are of either Page Type X or Page Type Y.
I've delved into the core page_list code and can see where the filterByCollectionTypeID function is used to set a filter on the query but I get a little lost as this transitions into the executable code within the core database_item_list.php.
From my limited knowledge, I'm not quite sure as to how I should override the code to include this logical OR into this filter.
Any guidance or help would be appreciated.
Regards,
Dan
I've run into a challenge where by I could do with creating a page list block that filters not just by one Page Type but rather two, so that the resultant list of pages are of either Page Type X or Page Type Y.
I've delved into the core page_list code and can see where the filterByCollectionTypeID function is used to set a filter on the query but I get a little lost as this transitions into the executable code within the core database_item_list.php.
From my limited knowledge, I'm not quite sure as to how I should override the code to include this logical OR into this filter.
Any guidance or help would be appreciated.
Regards,
Dan
Thanks Tim,
It was right under my nose I guess. I've now overridden the Page List Block controller getPageList method and utilised the filterByCollectionTypeHandle method instead of the filterByCollectionTypeID for the scenario where I needed to handle it differently.
Works great.
Regards,
Dan
It was right under my nose I guess. I've now overridden the Page List Block controller getPageList method and utilised the filterByCollectionTypeHandle method instead of the filterByCollectionTypeID for the scenario where I needed to handle it differently.
Works great.
Regards,
Dan
Awesome!
What file did you place the code in?
Something like this could be placed into a page template.
http://www.weblicating.com/doku/doku.php?id=cheatsheet...