Cockpit CMS Moderation Addon
This addon extends Cockpit CMS core functionality by introducing the possibility to have moderation of collections. It means that its possible to create collections with a status (Unpublished, Draft or Published) affecting the way that entries are retrieved:
- Unpublished - Any collection entry in unpublished state will be filtered out.
- Draft - Any collection entry in Draft that doesn't have a previous revision in published status will be also filtered out. If there is a previous revision with published status the revision will be returned instead. However on a scenario that we have a published > unpublished > draft sequence no entry will be returned.
- Published - They are always returned.
- Confirm that you have Cockpit CMS (Next branch) installed and working.
- Download zip and extract to 'your-cockpit-docroot/addons' (e.g. cockpitcms/addons/Moderation, the addon folder name must be Moderation)
- Edit one collection and confirm that you have a new field type (Moderation).
- Access addon settings page (http://your-cockpit-site/settings/moderation) and confirm that page loads.
To use the main functionality of the addon no extra configuration is required. To use the preview mode (Draft entries will be also returned) is required to configure an API key on the addon settings page. You can use the moderation api key in your requests like:
There is only one permission (manage) that can be used to manage addon settings page.
Add a new field to your collection of type Moderation:
And when editing a collection that is using that field a moderation section will be displaye in the sidebar:
You can name whatever you want for your moderation field, e.g. status, moderation, etc.. But you need to keep in mind if you change the field later you may need to manually update all existing collection entries.
Copyright and license
Copyright 2018 pauloamgomes under the MIT license.