Author: Ondřej Janošík, Martin Čapek
NOTUM Technologies is an official Strapi Partner and a custom software development agency based in Czech Republic. Our speciality is web and mobile app development. We provide our service for both startups and corporate clients across more than 10 countries and our apps are used by more than 5 000 000 users every month.
The “strapi-plugin-content-versioning” allows you to:
- Have multiple draft versions of one entity ✅
- Keep a history of all changes (with time travel) ✅
- Have different published and draft data ✅
We really love STRAPI (as you might have guessed) but one thing that we were missing across a variety of projects was content versioning - especially the ability to have a different version of a draft and published data and to keep history of all the data.
We developed this plugin during the development of a new site based on Strapi v4 for a Czech insurance company called Direct. With the permission of the client, we released it as an open-source plugin and we are going to further continue with its development. 🎉
Our plugin is inspired by the Strapi Content Internationalization (i18n) feature. The i18n plugin works the same way on a low level when creating localized versions. Therefore, we created a specific id of the versions concerned that groups all versions of the same entry and also creates a relation between entries.
Since we can leverage the power of the Draft and Publish system, your controllers should work without any additional coding or changes. A big help in creating our plugin is the new Plugin API that is useful when working with Strapi’s core code without needing to rewrite files.
The whole plugin is composed of 3 main parts:
- Custom controller that manages saving and creating new versions.
- Middleware that filters only relevant versions on the list.
- Components placed on the side panel that are injected into ‘informations zone’.
Given the fact that we are intensively collaborating with Strapi we will be updating the project based on feature requests from our client and the community. Features coming up next are:
✨ One command installation
✨ Extension of functionality also for single types
✨ Update of the current version without creating a new history item
✨ Auto preview mode for getting draft entry
But first, we would like to release a stable version. The plugin is not easy to release and we expect many edge cases in different usages.
We would love to hear your feedback! Please use GitHub issues for feature requests/bug reports and questions. Also, you are more than welcome to contribute to the project!
npm install @notum-cz/strapi-plugin-content-versioning