Filtering Page List Block with Multiple Filters

Permalink
I have a page_list block template, being used inside a jquery slideshow, so that pages with "calendar_event" page types, will show.

The client would like the block to show pages based on this criteria:
calendar_event_is_featured = 1 (Is Featured)
calendar_event_end_date_time >= today (Event Has Not Past)
page_type_handle = calendar_event (To Endure Only Events)

I can get it to work off of one filter, and have tired numerous ways to do this based on tons of web research, but I just can't get them to show based on all 3 criteria, with test event pages.

Here's the debug()-- it seems fine:
(mysqlt): select p1.cID, pt.ctHandle from Pages p1 left join Pages p2 on (p1.cPointerID = p2.cID) left join PagePaths on (PagePaths.cID = p1.cID and PagePaths.ppIsCanonical = 1) left join PageSearchIndex psi on (psi.cID = if(p2.cID is null, p1.cID, p2.cID)) inner join CollectionVersions cv on (cv.cID = if(p2.cID is null, p1.cID, p2.cID) and cvID = (select cvID from CollectionVersions where cvIsApproved = 1 and cID = cv.cID)) left join PageTypes pt on pt.ctID = cv.ctID inner join Collections c on (c.cID = if(p2.cID is null, p1.cID, p2.cID)) left join CollectionSearchIndexAttributes on (CollectionSearchIndexAttributes.cID = if (p2.cID is null, p1.cID, p2.cID)) where 1=1 and cvName != '' and pt.ctID = '26' and (ak_exclude_page_list = 0 or ak_exclude_page_list is null) and cvIsApproved = '1' and (p1.cIsTemplate = 0 or p2.cIsTemplate = 0) and p1.cIsActive = '1' and ak_calendar_event_end_date_time >= '2015-05-06' and ak_calendar_event_is_featured = 1 order by p1.cDisplayOrder asc


Thanks.

Sample page_list view.php:
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$th = Loader::helper('text');
$ih = Loader::helper('image'); 
$pl->filter('ctHandle', "calendar_event");
$pl->filter('ak_calendar_event_end_date_time', date('Y-m-d'), '>=');
$pl->filter(false, "ak_calendar_event_is_featured = 1");
$pl->debug();
$results = $pl->get(); 
?>
<div class="slider-tabs event flexslider">
  <ul class="slides">
    <?php 
   if(is_array($results)){ foreach($results as $page){ 
      // Title

Deladroid
 
MrKDilkington replied on at Permalink Reply
MrKDilkington
I'm also interested in techniques for filtering the page list block using multiple filters.
razorcommerce replied on at Permalink Reply
razorcommerce
Is this for 5.6? In 5.7 there is no ctHandle instead it's ptHandle. There is also a specific method for filteringByPageType(). Which is not going to help if this is 5.6 as it would seem to be.
Deladroid replied on at Permalink Reply
Deladroid
This is version 5.6.3.3

It also seems like the biggest issue I deal with is the block sometimes appearing like it's working correctly right after a change, and then subsequent tests by changing settings of existing events or creating new events will then not show up or remove, no matter how much cache clearing, browser flushing, etc, I do (caching is technically off for the test site).
hutman replied on at Permalink Reply
hutman
I believe it will work if you do this

$pl->filterByCollectionTypeHandle("calendar_event");
$pl->filterByAttribute('calendar_event_is_featured', 1, '=');
$pl->filterByAttribute('calendar_event_end_date_time', date('Y-m-d'), '>=');
$pl->debug();
MrKDilkington replied on at Permalink Reply
MrKDilkington
@hutman

Just to clarify, you can "layer" filterByAttribute()?

So, the first filter narrows the list down, and then the second filter further narrows down the list from there?
hutman replied on at Permalink Reply
hutman
I have done this with just a regular PageList, not the Page List Block and it only returned results that matched all criteria.
inspireanup replied on at Permalink Reply
Even Im looking for something similar to this. For my site Im in need of filtering page list with multiple filters. Can you please explain bit how can i PageList to achieve this task ? Will be looking for your response. Thanks in advance.
MrKDilkington replied on at Permalink Reply
MrKDilkington
I am afraid sequential filters didn't narrow the list down as expected on 5.7.

At risk of hijacking this thread, it would be great to hear more about ways to use:
- multiple filters
- and/or use of multiple filters
mhawke replied on at Permalink Best Answer Reply
mhawke
Hey folks, this is a forum where clients look to hire someone to complete a job for them. If this is turning into a regular forum discussion then could we please move it out of the Jobs forum so I can choose whether I want to subscribe to the discussion. Please and thank you.