Kirby Scheduled Pages

Yes, I know you missed my plugins. It was like two days since I published the last one.

Kirby Scheduled Pages

Want to publish pages on a future date? Now you can. With the field in combination with the helper functions it’s quite simple.

To get pages that are not set to a future date you can do something like this:

foreach( $pages->unscheduled() as $item ) {
  echo $item->title() . '<br>';

Combine it with Kirby Status plugin

This plugin work well with Kirby Status.

The code below will only show published pages that are not set to a future date:

foreach( $pages->published()->unscheduled() as $item ) {
  echo $item->title() . '<br>';

Thanks Jens “Head of Kirby Plugin Department” Törnell!
It’s amazing how you not only publish plugins so often, but also seem to read my mind regarding the functions. This is something I wanted to simplify myself since quite a while.

You’re awesome! :clap:


Thanks for that plugin. I didn’t find any info, so I have to ask: does it handle caching?

I’ve implemented a similar functionality on my blog, but the problem always is the cache. I can schedule posts, but they will only appear, when I clear the cache. Does your plugin take care of that?

No it does not, sorry! I don’t know how that would work.

Okay, thank you for letting me know :slight_smile:

I needed this to work with cached pages, so I worked a bit further on @jenstornell “scheduled pages” core idea and hacked in a cache invalidator so there is no need for a controller / function in each template.

Please have a look:

This is my first “public” plugin and it might be focussed to much on my use case tbh.
I’m always interested in suggestions: comments are encouraged.

Hey @jenstornell, sorry for the newbie question here…

I’m trying to install both the status and schedule-pages plugins but don’t see them reflected on the panel yet.
I just dragged the unzipped folders from GitHub and dragged them into the site/plugins folder.

Looks like this:

Am I missing something?

Scheduled pages: Have you set up the blueprint as described in the readme? Fieldname is important.
Status plugin: Have you added the status field in your blueprint?

Thanks @texnixe.

I managed to get the Schedule-pages working.
But when adding the status field to the page blueprint I get this error:

The status field is missing. Please add it to your installed fields or remove it from your blueprint

And the blueprint looks like this:

Yes, there seems to be something missing. There is no file called status.php that registers the field and the methods. As it is, this plugin will not work. Maybe @jenstornell accidentally deleted the origin status.php file that was in his first commit? As a workaround, you can move the files in the plugins’s /field folder into your project’s /site/fields/status/folder and then put all the other files (controller-helper.php, page-methods.php and pages-methods.php) directly into site/plugins (without a subfolder)

(Explanation: Plugins are only loaded if the name of the folder and the name of the plugin’s main file are the same, e.g. folder “status” => file status.php. Additionally, if your plugin contains fields or other stuff, these must be registered in the main file.)

@renegdn @texnixe

I’ve added a quick fix for it and put back an old file. Really strange that it was missing. I have no clue how that could have happened.

Anyway, I’m on an important project right now and did not have the time to test it out but it should work.

If you are not sure what do to, just remove the plugin and download it and install it again.