Filter out future-dated pages

Permalink Browser Info Environment
Is there a way to filter out future-dated pages?
I know it could be done in the view, but that would make paging inconsistent.
I'd rather not override the controller, if avoidable.

If this isn't a feature yet, please consider this a request! This seems important if this is to be used in a blog setting where people can create future-dated posts that will publish at a later date (without using the timed features of Concrete5, which don't make sense in this scenario).

Thanks!

Type: Discussion
Status: New
kirkroberts
View Replies:
hereNT replied on at Permalink Reply
hereNT
That's kind of a bug with the core - the standard page list block does the same thing. IIRC, Frz once said that "cDatePublic" is just some arbitrary date that is not used by *anything* - the recommendation was to just use permissions for it.

That said, I think I could use it in a custom filter, but I'd worry a bit about not being consistent with the core, or changing things for people that aren't expecting it. They might end up losing a lot of pages on some sites.

I'll think about it, though. If other people want to weigh in, that would be awesome.
kirkroberts replied on at Permalink Reply
kirkroberts
Quick 'n' dirty: added one line to controller.php's getPages() function:

public function getPages() {
      $pl = $this->getPageList();
      // only current day or past-dated items
      $pl->filter('cvDatePublic', date('Y-m-d'), '<=');
      if ($pl->getItemsPerPage() > 0) {
         $pages = $pl->getPage();
      } else {
         $pages = $pl->get();
      }
      $this->set('pl', $pl);
      return $pages;
   }


Maybe this could be a checkbox option in the Oembed Page List block?
hereNT replied on at Permalink Reply
hereNT
Yeah, I had to do that with ProBlog on one site, before I stopped using it.

A checkbox should work, I think. But just doing it for every instance seems dangerous.
kirkroberts replied on at Permalink Reply
kirkroberts
I don't recommend it for every instance, but I can see how it would be "safe". The date is automatically set to today's date when you create a page, so someone would have to manually set it to the future. That seems unlikely.

But yeah, I can see why it should be a checkbox, just in case!

And then, datePublic as an "arbitrary date"?!?!
You can sort page lists by date.
I assume that is how the "timed release" works as well.
That doesn't seem arbitrary at all.
hereNT replied on at Permalink Reply
hereNT
Yeah, you can sort them. But it doesn't filter them. It never has.

http://www.concrete5.org/community/forums/usage/what_is_andquotpubl...

I have no idea why they set it up that way. Just one of the many 'quirks' of c5 held over from before it was open source, I guess...
kirkroberts replied on at Permalink Reply
kirkroberts
Right, sorting and filtering are two different operations. That makes sense to me.

It would be great if you added an "exclude future-dated pages" checkbox to the Oembed page list. The core one should have that, too (it would be a simple way to schedule release or just hide a page)... but that's another issue.

Thanks for your attention on this!

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.