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!
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 |
Quick 'n' dirty: added one line to controller.php's getPages() function:
Maybe this could be a checkbox option in the Oembed Page List block?
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?
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.
A checkbox should work, I think. But just doing it for every instance seems dangerous.
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.
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.
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...
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...
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!
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!
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.