Creating a new PageList block to filter by Public Date

Hi all,

I'm trying to create a new block based on the Page List block (although maybe I really only need a new template based on the Blog Index template for the existing Page List block?). What I would like to do is have it so that the Page List only displays a list of pages whose Public Date is earlier than, or equal to, today (i.e... don't show pages that are dated in the future).

I'd like to use this as a means of enabling a friend to manage a blog in Concrete5 in a way that is more like what they're used to from that by setting the "Public Date" to a date in the future, they can control when a new posting will appear on the website (I know that Advanced Permissions allow for setting the Release Date of the page, but this isn't intuitive for this particular user).

So... I found this posting ( ) that appears to have the code that I'd be looking for, but I can't quite seem to get it to work right.

Can anyone give me a kick in the right direction? Should I be looking at editing the controller.php for the block? Or would this code be placed in the view.php to filter things out when being displayed?

Thanks for any help you can provide (sorry to be such a n00b)!

- John

View Replies: View Best Answer
Mainio replied on at Permalink Best Answer Reply
In the page_list block folder's controller.php around line 48:
$pl = new PageList();

$pl = new PageList();
$pl->filter('cvDatePublic', date('Y-m-d'), '<=');

- Antti
arrestingdevelopment replied on at Permalink Reply
Thanks, Antti.

I just gave this a try, but it doesn't appear to have any effect. Maybe I did something wrong?


- John
arrestingdevelopment replied on at Permalink Reply
OK... scratch my last "it didn't work" posting.

I got this working! Turns out it was a typo (DOH! That's what I get for re-typing instead of copying and pasting, right?)!