DEV Community

Cover image for New Community Plugin: Content Versioning
Shada for Strapi

Posted on • Originally published at strapi.io

New Community Plugin: Content Versioning

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.

🚀 About the plugin

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 ✅

Why we built it?

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. 🎉

How does it work under the hood?

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:

  1. Custom controller that manages saving and creating new versions.
  2. Middleware that filters only relevant versions on the list.
  3. Components placed on the side panel that are injected into ‘informations zone’.

What’s next on the roadmap?

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
✨ Autosave
✨ 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.

How can others contribute

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!

Install now

npm install @notum-cz/strapi-plugin-content-versioning
Enter fullscreen mode Exit fullscreen mode

Top comments (0)