Page List Controller Filter

Permalink
I'm trying to filter a Page List in the controller by a single page ID (filter out the page with the specified ID). There doesn't seem to be a in-built function for it, so I'm trying to use generic filter() function but with no luck.

Let's say for example that the example below is trying to filter out the home page.

$pl->filter('cID', '1', '!=');


I'm guessing that the only thing I'm missing is the correct handle for page ID.

 
MrWalshMan replied on at Permalink Reply
I've gotten somewhere with this. The following example will filter out the home page:

$pl->filter('p1.cID', '1', '!=');


Which is great, however the opposite doesn't work. Ideally, the below example would filter everything BUT the home page:

$pl->filter('p1.cID', '1', '=');


But it just filters out everything instead.
HardOne replied on at Permalink Reply
HardOne
It's really late and I did not think much about it, but a single = is afaik not a valid comparison operator. == should do it.

$pl->filter('p1.cID', '1', '==');