ExpressionEngine is having a good feature of channel entry versioning in which entry’s versions can be saved. This feature can be enabled from the channel preferences under “Versioning Preferences”.

Versioning Preferences

Once this preference has been set, while saving an entry of that channel, previous versions or previous data of entry will be saved. These revisions of can be seen under the “Revisions” tab of “Edit Entry” page of Control Panel.

Entry Edit Page of Control Panel

You can see that the previous revisions can be loaded by clicking at “Load Revision”.

In website development, it may require to populate the previous changes made within an entry. To accomplish such type of requirement one can use entry revision feature. But I couldn’t get any guidance so that we can fetch and populate the entry revisions at front end so that a visitor can see when and what was updated for an entry.

So let’s achieve it.

The entry version data is being saved within the database table “360_entry_versioning” but in the serialized format. I tried with SQL using Query Module to get entry versions data using MySQL function “SUBSTRING_INDEX” like:

But above will not work properly :( and its really not a good approach. I think, MySQL couldn’t deal with serialized data.

We can do it properly via PHP with unserialize function:

In above PHP code example, one can fetch/print other data of channel entry with array $edata.

Please Note: I developed a plugin Entry Revisions. It would be better to use plugin.

ABOUT US

We offer full range of creative services, from design to development, multimedia, e-commerce, CMS development and mobile application development

We are expert in CMS's like ExpressionEngine, Craft CMS, Statamic, WordPress and many others.

MORE

CONTACT US

+91(522)-4081932

SEND US A MESSAGE
Message has been sent to us.
Error sending your message.