Extensions & Integrations
Document Versions



Installation
To install the module, use the command line to run this command in an Apostrophe project's root directory:
npm install @apostrophecms-pro/document-versions
Usage
Configure the Document Versions module in the app.js
file:
require('apostrophe')({
shortName: 'my-project',
modules: {
'@apostrophecms-pro/document-versions': {}
}
});
Open the Document Versions management
The module doesn't need any additional configuration. The document versions will be created automatically after every document publishing operation - create or update. The dedicated management area can be accessed via the document context menu labeled "Document Versions" - it is presented together with the core menu actions "Edit", "Duplicate...", "Localize...", etc.
List and View Document Versions
The versions navigation for a given document is shown on the right side of the dedicated management modal window. Every version shows its creation date and author. The versions are ordered by reverse date of their creation. The most recent version is on top. When initially entering the document versions management area the most recent (first in the navigation on the right) version will be loaded and its content will be previewed in the center of the screen. The preview layout is the same as the well known Editor Modal. The field groups navigation is on the left and the corresponding content schema in the middle. The only major difference is that the fields are read-only.
Version preview may be switched via the right side navigation by clicking the desired date.
Restore a Document Version
While in the Document Versions management area for a given document go over the right side version navigation with your mouse. A restore button will be revealed for every version. Clicking it will restore the Draft of the current document with the chosen content version. Keep in mind this operation won't publish your change, this has to be done manually.
What documents are under version control?
- Every document type that is not explicitly enabling autopublish (
autopublish: true
). For example the core piece "Image Tags" will not have any versions recorded because it has theautopublish
option set totrue
. - Every document type that is not explicitly disabling localization (
localized: false
). For example the core piece "Users" will not have any versions recorded because it has thelocalized
option set tofalse
.