pauloamgomes/cockpitcms-autosave

This package is abandoned and no longer maintained. No replacement package was suggested.

Autosave addon for Cockpit CMS, provides autosave capabilities for collections and singletons

1.0.0 2021-03-22 10:47 UTC

This package is auto-updated.

Last update: 2023-06-07 14:07:24 UTC


README

This add-on enhances Cockpit CMS by providing the ability to persist automatically changes on collection entries or singletons form data. That means if the user closes by mistake the browser (by mistake or by a system failure) the changes will not be lost and when someone tries to edit the same resource, the system will ask if he wants to continue from a previous saved version.

Installation

Manual

Download latest release and extract to COCKPIT_PATH/addons/Autosave directory

Git

git clone https://github.com/pauloamgomes/CockpitCMS-Autosave.git ./addons/Autosave

Cockpit CLI

php ./cp install/addon --name Autosave --url https://github.com/pauloamgomes/CockpitCMS-Autosave.git

Composer

  1. Make sure path to cockpit addons is defined in your projects' composer.json file:
{
    "name": "MY_PROJECT",
    "extra": {
        "installer-paths": {
            "cockpit/addons/{$name}": ["type:cockpit-module"]
        }
    }
}
  1. In your project root run:
composer require pauloamgomes/cockpitcms-autosave

Configuration

In order to use the addon, it's required to specifiy in the Cockpit config the collections and/or singletons we want to autosave, e.g.:

autosave:
  collections: *
  singletons:
    - settings
    - seo

In the above example we are saying to apply Autosave to all collections (use of *) and to specifically the singletons with name "settings" and "seo".

For non admin users its required to provide a permission ("access"), e.g.:

groups:
  editor:
    autosave:
      access: true

Usage

When enabled, the addon will provide a small sidebar block that will display status of autosaves user did:

Autosave Screencast

When using Autosave, only a version is stored in the database containing the latest changes user did in the resource. When user saves the resource, the autosave entry is automatically removed.

Copyright and license

Copyright 2019 pauloamgomes under the MIT license.