Versioning for the Panel

Hey there,

recently my uncle deletes something on a page by accident and without a backup. So I wonder how versioning could be realized inside the Panel.

My first ideas:

  1. Every page has a invisible folder named “_versions
  2. Everytime the user saves a page (yay, new panel hooks!), the old version will be archived to that folder like “YYYYMMDDHHMMSS.txt
  3. Some fancy UI to show and restore older versions.
  4. If an older Version is restored, it will be a new version, so no versions will be deleted

What do you think?


I’m all for versioning, but it doesn’t replace a backup: if you have files in your pages, they won’t be restored when you choose a previous version of the text file.

Some kind of diff would be lovely. Probably side by side as it seems easier to compare the content of multiple fields.

Of course, versioning doesn’t replace a proper backup; on the other hand a backup is not necessarily easily accessible to an editor if he/she/it has accidentally deleted content or wants to go back to a previous version for whatever reason. So having both a backup and versioning plus an easy way to compare versions makes perfect sense.

files could be restored, too: "_archive/YYYYMMDDHHMMSS/" as a folder wich is a copy of the original folder, with all the files in it. (Maybe with hardlinks available on the current filesystem to save space)

What if the content folder had its own git repo and everytime it was saved this hook would run a shell script that add and commit those changes? So you could revert changes from the terminal.

That might solve the files problem that @Malvese mentioned… but with great power comes big responsibility… I mean the hurdles of git version control…

I don’t think git is the right tool for most editors like my uncle. For example, his webspace is not capable for git…

Got it… also not the most user-friendly approach as well.
Solving the problem in the panel would be the right way with the user in perspective.

1 Like