A plugin for Strapi that provides the ability to easily schedule publishing and unpublishing of any content type

Overview

strapi-plugin-publisher

A plugin for Strapi that provides the ability to easily schedule publishing and unpublishing of any content type.

Downloads Install size Package version

Requirements

The installation requirements are the same as Strapi itself and can be found in the documentation on the Quick Start page in the Prerequisites info card.

Supported Strapi versions

  • v4.x.x

NOTE: While this plugin may work with the older Strapi versions, they are not supported, it is always recommended to use the latest version of Strapi.

Installation

npm install strapi-plugin-publisher

or

yarn add strapi-plugin-publisher

Configuration

Enable the plugin

The plugin configuration is stored in a config file located at ./config/plugins.js.

module.exports = ({ env }) => ({
	publisher: {
		enabled: true,
	},
});

Enable server cron

The cron.enabled configuration option needs to be set to true in Server Configuration for the plugin to work.

Usage

Once the plugin has been installed, configured and enabled a Publisher section will be added to the informations section of the edit view for all content types (single + collection) that have draftAndPublish enabled. The Publisher section will provide the ability to schedule publishing and unpublishing of the content type. The content type publication status is checked every minute.

If the Publisher section does not appear after the plugin is enabled trigger a clean rebuild of the admin

Single Content Type

Sample single content type publisher section

Collection Content Type

Sample collection content type publisher section

Adding a (un)publish date

Navigate to the entity record that should be (un)published, under the informations section click the Add a (un)publish date button. Enter in the date and click save, the entity record will then be (un)published at the specified time.

default

Add a (un)publish date

Editing a (un)publish date

Navigate to the entity record that requires its date changed, under the informations section click the Edit (un)publish date button. Enter in the new date and click save.

Edit a (un)publish date

Deleting a (un)publish date

Navigate to the entity record that contains the date that should be removed, under the informations section click the Delete (un)publish date button.

Delete a (un)publish date

Bugs

If any bugs are found please report them as a Github Issue

Comments
  • Feature request: Purge REST Cache

    Feature request: Purge REST Cache

    Hi! Thanks for your plugin!

    It would be significant enhancement to purge REST Cache (https://strapi-community.github.io/strapi-plugin-rest-cache/) on publish/unpublish

    enhancement 
    opened by imwexpex 7
  • Publishing every time

    Publishing every time

    On a linux server, it seems like the plugin is publishing not relating on the date. Even if I put a date that is far in time to publish: image image When the cron action gets launched, the entry get published not considering the date. image

    I checked dates and they seem great: image

    bug 
    opened by GautierDele 7
  • Upstream dependency conflict

    Upstream dependency conflict

    When installing this plugin, I get the following dependency error:

    ~/dev/my-project$ npm install strapi-plugin-publisher
    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE could not resolve
    npm ERR! 
    npm ERR! While resolving: [email protected]
    npm ERR! Found: [email protected]
    npm ERR! node_modules/react-router-dom
    npm ERR!   peer react-router-dom@"^5.2.0" from @strapi/[email protected]
    npm ERR!   node_modules/@strapi/design-system
    npm ERR!     @strapi/design-system@"1.2.1" from @strapi/[email protected]
    npm ERR!     node_modules/@strapi/admin
    npm ERR!       @strapi/admin@"4.3.6" from @strapi/[email protected]
    npm ERR!       node_modules/@strapi/strapi
    npm ERR!         peer @strapi/strapi@"^4.3.4" from @strapi/[email protected]
    npm ERR!         11 more (@strapi/plugin-graphql, @strapi/plugin-seo, ...)
    npm ERR!     peer @strapi/design-system@"^1.2.0" from [email protected]
    npm ERR!     node_modules/strapi-plugin-menus
    npm ERR!       strapi-plugin-menus@"^1.0.2" from the root project
    npm ERR! 
    npm ERR! Could not resolve dependency:
    npm ERR! strapi-plugin-publisher@"*" from the root project
    npm ERR! 
    npm ERR! Conflicting peer dependency: [email protected]
    npm ERR! node_modules/react-router-dom
    npm ERR!   peer react-router-dom@"^6.2.1" from [email protected]
    npm ERR!   node_modules/strapi-plugin-publisher
    npm ERR!     strapi-plugin-publisher@"*" from the root project
    npm ERR! 
    npm ERR! Fix the upstream dependency conflict, or retry
    npm ERR! this command with --force, or --legacy-peer-deps
    npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
    

    Stapi version 4.3.6. Is this my setup or is it a problem with the plugin?

    opened by BabyDino 6
  • Publisher section not added to the informations

    Publisher section not added to the informations

    I have install and enabled the plugin, but unfortunately, the section Publisher not apear at the content-type informations.

    Any help?

    config/server.ts:

    export default ({ env }) => ({
      //...
      cron: {
        enabled: true,
      },
    });
    

    config/plugins.ts:

    export default ({ env }) => ({
        //...
        publisher: {
          enabled: true,
        },,
    });
    

    Plugin version: "strapi-plugin-publisher": "^1.1.3" Strapi version: "@strapi/strapi": "4.3.4"

    image

    opened by rodgeraraujo 5
  • Bug: won't trigger webhooks

    Bug: won't trigger webhooks

    Hello,

    It seems like your plugin doesn't trigger webhooks. Basically when the publish / unpublish event gets triggered, it seems like my webhoobs related to publish and unpublish event are not launched

    bug 
    opened by GautierDele 2
  • use

    use "default" variant for publish button

    Another tiny fix: The "Add a publish date" uses the primary variant, but the variant is actually named default, according to here: https://design-system-git-main-strapijs.vercel.app/?path=/story/design-system-components-button--variants

    This only prints a warning to the console when run in dev mode with the --watch-admin option, I assume because the warning is suppressed otherwise.

    The button component appears to be falling back to the default variant in any case, so this doesn't affect how it actually gets rendered. The main effect is just to get rid of that warning in the console.

    opened by jfmontanaro 1
  • Upload publish date through REST API

    Upload publish date through REST API

    I have a list of content with publish dates from the future and I would like to POST them to Strapi through API with the publish date schedule included, this plugin allows me to do this?

    opened by joao-pedrozo 0
  • fix:(ActionFooter): delete + add edge case

    fix:(ActionFooter): delete + add edge case

    • feat(api): add actions
    • feat(utils): add isEmpty and getTrad, remove hasResponseData
    • feat(trad): add en translation
    • feat(hooks): add useReactQuery
    • refactor(components): use react-query for state (fixes delete/add edge case)
    • chore(assets): add new images for redesign
    opened by ComfortablyCoding 0
  • [feature] Query for Scheduled Dates

    [feature] Query for Scheduled Dates

    Hi there, I love the plugin you've written, it has been super easy to set up and use. One feature I'm trying to add to my website is a display showing the upcoming posts and their publish dates. It seems the REST endpoint /publisher/actions has this info, but it requires an admin token and it doesn't seem to be configurable to give access to other roles.

    Is this something that could be added, or do you have any pointers for how I could implement it? I wouldn't mind doing it myself but I don't have any experience writing plugins so the overhead of learning all that makes it a bit prohibitive for me.

    opened by Jahorse 0
  • [bug] Cron tasks is executing every  minute publisher plugin is disabled

    [bug] Cron tasks is executing every minute publisher plugin is disabled

    In config/plugins.js file publisher is set to disable:

        publisher: {
    	enabled:  false,
        }
    

    Looking at the log the cron task is executing every minute, regardless of the publisher plugin being disabled. Web console is OK as the publisher buttons are not being showed, but the log shows that the crontask '*/1 * * * *' still executes itself. Cron task should at least verify the plugin is activated in order to avoid not useful executions.

    Found out because I'm getting this error:

    9|strapi-prod  | 2022-12-20T18:13:00: KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
    9|strapi-prod  | 2022-12-20T18:13:00:     at Client_PG.acquireConnection (/opt/apps/strapi-prod/node_modules/knex/lib/client.js:310:26)
    9|strapi-prod  | 2022-12-20T18:13:00:     at async Runner.ensureConnection (/opt/apps/strapi-prod/node_modules/knex/lib/execution/runner.js:294:28)
    9|strapi-prod  | 2022-12-20T18:13:00:     at async Runner.run (/opt/apps/strapi-prod/node_modules/knex/lib/execution/runner.js:30:19)
    9|strapi-prod  | 2022-12-20T18:13:00:     at async Object.execute (/opt/apps/strapi-prod/node_modules/@strapi/database/lib/query/query-builder.js:396:22)
    9|strapi-prod  | 2022-12-20T18:13:00:     at async Object.findMany (/opt/apps/strapi-prod/node_modules/@strapi/database/lib/entity-manager/index.js:142:22)
    9|strapi-prod  | 2022-12-20T18:13:00:     at async Object.findMany (/opt/apps/strapi-prod/node_modules/@strapi/strapi/lib/services/entity-service/index.js:313:20)
    9|strapi-prod  | 2022-12-20T18:13:00:     at async Object.findMany (/opt/apps/strapi-prod/node_modules/@strapi-community/strapi-plugin-url-alias/server/admin-api/services/override-query-layer.js:17:28)
    9|strapi-prod  | 2022-12-20T18:13:00:     at async Object.*/1 * * * * (/opt/apps/strapi-prod/node_modules/strapi-plugin-publisher/server/config/cron-tasks.js:11:21)
    
    

    Tried hot patching the cron string to 0 0 */30 * * but it still shows the error with the 1 minute cron string. Also related (but I've seen that this is a common mis-practice in most Strapi development) all propmises are treated in an optimistic way. All Promise based functions use async-await without considering that something can (and will) probably fail, so there's no error catching.

    Strapi version: 4.4.3 Publisher plugin version: 1.1.3 (checked vs Github and cront-task.js file is the same I have on my installation).

    opened by jsanta 2
  • [feature] increase the time picker steps

    [feature] increase the time picker steps

    Hello,

    First of all, thank you for the great plugin. I want to request a feature that improves the publication time setting.

    The time picker next to the publish date is displayed per minute. Can this be adjusted to 15 minutes intervals? This functionality is supported by the Strapi TimePicker.

    Optionally let users configure the interval option.

    Screenshot image

    Have a nice day.

    opened by Rgeelen 2
Releases(1.1.4)
  • 1.1.4(Oct 4, 2022)

    What's Changed

    • Fix typo in unpublish button by @jfmontanaro in https://github.com/ComfortablyCoding/strapi-plugin-publisher/pull/20
    • use "default" variant for publish button by @jfmontanaro in https://github.com/ComfortablyCoding/strapi-plugin-publisher/pull/21
    • fix(fr): wrong translation of unpublish by @geetsww in https://github.com/ComfortablyCoding/strapi-plugin-publisher/pull/29
    • fix(peer deps): versions should match strapis by @ComfortablyCoding in https://github.com/ComfortablyCoding/strapi-plugin-publisher/pull/30
    • chore(deps): incorrect engines syntax by @ComfortablyCoding in https://github.com/ComfortablyCoding/strapi-plugin-publisher/pull/32

    New Contributors

    • @jfmontanaro made their first contribution in https://github.com/ComfortablyCoding/strapi-plugin-publisher/pull/20
    • @geetsww made their first contribution in https://github.com/ComfortablyCoding/strapi-plugin-publisher/pull/29

    Full Changelog: https://github.com/ComfortablyCoding/strapi-plugin-publisher/compare/1.1.3...1.1.4

    Source code(tar.gz)
    Source code(zip)
  • 1.1.3(Mar 4, 2022)

    What's Changed

    • fix (cronTasks): account for new date filter forma by @GautierDele in https://github.com/ComfortablyCoding/strapi-plugin-publisher/pull/16
    • feat(translations): add french by @GautierDele in https://github.com/ComfortablyCoding/strapi-plugin-publisher/pull/16

    New Contributors

    • @GautierDele made their first contribution in https://github.com/ComfortablyCoding/strapi-plugin-publisher/pull/16

    Full Changelog: https://github.com/ComfortablyCoding/strapi-plugin-publisher/compare/1.1.2...1.1.3

    Source code(tar.gz)
    Source code(zip)
  • 1.1.2(Feb 25, 2022)

    What's Changed

    • chore(README): add clarifications and fix typos by @ComfortablyCoding in https://github.com/ComfortablyCoding/strapi-plugin-publisher/pull/6
    • refactor: improve button ux by @ComfortablyCoding in https://github.com/ComfortablyCoding/strapi-plugin-publisher/pull/7
    • fix:(ActionFooter): delete + add edge case by @ComfortablyCoding in https://github.com/ComfortablyCoding/strapi-plugin-publisher/pull/8
    • chore(assets): crop sample images to view port only by @ComfortablyCoding in https://github.com/ComfortablyCoding/strapi-plugin-publisher/pull/9
    • fefactor (cron): move cron registry seperate file by @ComfortablyCoding in https://github.com/ComfortablyCoding/strapi-plugin-publisher/pull/11
    • fix: trigger webhook on publication state toggle by @ComfortablyCoding in https://github.com/ComfortablyCoding/strapi-plugin-publisher/pull/12

    Full Changelog: https://github.com/ComfortablyCoding/strapi-plugin-publisher/compare/1.1.1...1.1.2

    Source code(tar.gz)
    Source code(zip)
  • 1.1.1(Feb 16, 2022)

    This release introduces the following changes:

    • add unpublish action mode (#2)
    • add sample images and badges to readme (#4)
    • fix save not disabled when no date is provided (#3)
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Feb 15, 2022)

A plugin for Strapi Headless CMS that provides ability to sign-in/sign-up to an application by link had sent to email.

Strapi PasswordLess Plugin A plugin for Strapi Headless CMS that provides ability to sign-in/sign-up to an application by link had sent to email. A pl

Andrey Kucherenko 51 Dec 12, 2022
A plugin for Strapi Headless CMS that provides the ability to transform the API request or response.

strapi-plugin-transformer A plugin for Strapi that provides the ability to transform the API request and/or response. Requirements The installation re

daedalus 71 Jan 6, 2023
Strapi V4 Plugin to schedule publish and depublish actions

Strapi plugin scheduler This plugin allows you to publish and depublish collection types in the future. There are a couple of steps necessary to get t

Webbio 12 Nov 24, 2022
A plugin for Strapi CMS that adds a preview button and live view button to the content manager edit view.

Strapi Preview Button A plugin for Strapi CMS that adds a preview button and live view button to the content manager edit view. Get Started Features I

Matt Milburn 53 Dec 30, 2022
Provides a KafkaJS-compatible handler for processing messages that facilitates publishing to delayed-retry or dead-letter topics

kafkajs-async-retry This module handles retries and dead-lettering for messages from a Kafka topic without blocking the processing of subsequent messa

Shutterstock 5 Dec 5, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Visualize your Strapi content in month, week or daily view

Strapi Plugin Calendar Visualize your content in a map with month, weekly and daily view Demo Strapi Calendar Demo - Watch Video How to Install Copy t

Offset Development 20 Dec 9, 2022
100% type-safe query builder for node-postgres :: Generated types, call any function, tree-shakable, implicit type casts, and more

⚠️ This library is currently in alpha. Contributors wanted! tusken Postgres client from a galaxy far, far away. your database is the source-of-truth f

alloc 54 Dec 29, 2022
The iofod SDK provides developers with the ability to interact with the main iofod interface within the Web worker, enabling rapid development of iofod extensions through the SDK.

iofod-sdk English | 简体中文 The iofod SDK provides developers with the ability to interact with the main iofod interface within the Web worker, enabling

iofod, Inc. 47 Oct 17, 2022
An obsidian plugin for uploading local images embedded in markdown to remote store and export markdown for publishing to static site.

Obsidian Publish This plugin cloud upload all local images embedded in markdown to specified remote image store (support imgur only, currently) and ex

Addo.Zhang 7 Dec 13, 2022
Flexible plugin for Logseq that annotates deadline/schedule times with a countdown or time difference

Interval Hints Synopsis Configurable Logseq plugin to annotate deadline and scheduled times with a countdown or interval. Features Block renderer to a

Kerfuffle 8 Aug 29, 2022
A Tempermonky / Greasemonkey plugin which can help you export your class schedule to the calendar on your phone / pad / PC / Mac.

WHU Class Schedule Export as iCS Languages: English | 簡體中文 | 繁體中文 Changelog v0.90.1 - Sep 18, 2022 Fix bugs: Fix an error when a class have multiple s

Ostrich_B 6 Sep 7, 2022
A tiny JavaScript library to easily toggle the state of any HTML element in any contexts, and create UI components in no time.

A tiny JavaScript library to easily toggle the state of any HTML element in any contexts, and create UI components in no time. Dropdown, navigation bu

Matthieu Bué 277 Nov 25, 2022
a VS Code Extension for Easily Localize any blade/php text in any Laravel project.

Laravel Easy Localize a VS Code Extension for Easily Localize any blade/php text in any Laravel project. Features Custom array key for each translatio

Moataz Hajres 6 Oct 31, 2022
Basic types & utilities for Strapi v4 and plugin creators

Strapi v4 - Types & utilities Basic set of types and utilities for Strapi v4 and plugins creators A developers goodie for Strapi Headless CMS which pr

 VirtusLab Open-Source 7 Oct 14, 2022
A Bed and Breakfast dApp run on Ethereum. Includes a token + schedule system (Solidity) and full front-end (React + ethers.js) built with Hardhat.

Hotel ETH - Watch Demo Video Hotel ETH A (fictional) Bed-and-Breakfast run on Ethereum Come Book a Room on Kovan or Rinkeby Networks View the Demo » C

Ryan Lambert 20 Aug 20, 2022
Export Diagrams.net diagrams during Dendron site publishing

Export Diagrams.net diagrams during Dendron site publishing Node module for exporting Diagrams.net (Draw.io) diagrams embedded in a published Dendron

Luke Carrier 4 Aug 18, 2022