3

My client wants to look through very old versions of a certain page entry, but the Recent Versions drop-down is only showing a max of 10 entries. I know that older versions of the page exist because if I change the last number in the URL (of a more recent version) and I can access much older entries. Unfortunately, the are organized numerically by date (and not by page) so it makes them almost impossible to sift through.

Any help would be appreciated.

  • I just made a quick field type plugin and added it to my answer. Send me a shout on GitHub if you need any help with it! – Matt Stein Apr 22 '17 at 2:22
4

I don't think Craft has any other place for viewing old entry versions. You can browse the entire set by examining a table in the database, or write a plugin to display all of them.

Quick and Dirty

If you're just digging into this specific entry, you can pop into the craft_entryversions table and search for the entryId matching the one in question. You'll see all versions past and present, each with a bunch of JSON in the data column with that version's content.

Let's say you fancy one of those entries and its id column is 346 in the database. As you've already discovered, you can modify the entry's edit URL from...

/admin/entries/projects/1234-gobias-industries-about-page

...to...

/admin/entries/projects/1234-gobias-industries-about-page/versions/346

...and view it from the Craft control panel.

This is a bit uncomfortable of course, but you can quickly share a bunch of URLs with your client that'd make it easy to visit and inspect each version.

Slower and Cleaner

Otherwise you'd have to whip up a plugin to display additional version details in the control panel, probably linking to each version for further examination. If you're comfortable taking a stab at the plugin, it'd be fairly quick work displaying the results of craft()->entryRevisions->getVersionsByEntryId() however you like.

Versioneer

I just made a quick Field Type plugin for this. It's v0.0.1, but it may be worth checking out!

https://github.com/workingconcept/versioneer-craft-plugin

  • Nice! This is just begging to have some checkboxes next to the versions so you can compare compare those versions to one another... – RitterKnight Apr 22 '17 at 15:02
  • Wow. This is amazing. Thank you so much! Worked like a charm. – GD Squared Apr 24 '17 at 14:28
  • Happy it helped, @GDSquared! Please consider accepting the answer, and doing the same any time you've posted on this site and received a clear solution. – Matt Stein Apr 24 '17 at 18:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.