The Publisher plugin allows Strapi CMS users to schedule publishing and unpublishing of any content type. I have also created a few other Strapi plugins that you might find useful:
When the Strapi marketplace was released, I was interested in contributing useful plugins that would target a large audience of Strapi CMS users. While in the Strapi Discord, quite a few users mentioned their interest in some scheduled published content implementation for their Strapi instances. This was my first indication that a plugin covering this use case would be useful. I then noticed in the v3 docs that there was a guide for setting up auto-publishing on a cron, and that was the decider. The next day I started working on the first draft of the Publisher plugin.
Once the plugin is enabled, a Publisher section is added to all applicable content type records (i.e. any content type with draft and publish enabled). The section contains the option to add a publish or unpublish date for that record.
Once added, the plugin will track an action record for that change internally. Every minute the plugin will check if any publish/unpublish dates for content-type records has passed. If a date has passed, the plugin triggers the publication state change for the relevant records.
1strapi.cron.add({
2 "*/1 * * * *": async ({ strapi }) => {
3 // fetch all actions that have passed
4 const records = await getPluginService(strapi, "actionService").find({
5 filters: {
6 executeAt: {
7 $lte: new Date(),
8 },
9 },
10 });
11
12 // process action records
13 for (const record of records) {
14 getPluginService(strapi, "publicationService").toggle(
15 record,
16 record.mode
17 );
18 }
19 },
20});
I am constantly looking for new features to add to the plugin to make it more useful for users. Any suggestions are always welcome; at this point, the next feature planned is the following:
A list view to see all published/unpublished and scheduled content - This will provide editors and authors a good overview of the state of their content.
All contributions and ideas are welcome. The easiest way to do so is via github or discord. Github Discussion has been enabled on the repo for anyone with questions or ideas.
I am a full-stack Canadian programmer with an interest in the open-source community. I originally started off in Mechanical Engineering as I always had an interest in building things. It was there that I was introduced to programming and decided that programming was of more interest to me as a career. From there the rest is history.