Use your business data to your advantage with the help of Syncfusion’s new data science offerings. Discover how a custom big data solution can provide your company with valuable predictions about key market trends.

Introducing versioning

Now that you have learned how to add various types of content, from pages to events to news items, we're ready to introduce a feature of Plone called versioning, which is an important part of content management. The content items you work with in your Plone site may go through many changes over time. Plone provides versioning information to help you manage your content from the time it was initially created through to the current version.

By default, Plone provides versioning for the following content types:

Pages

News Items

Events

Links

Other content types can be configured to provide versioning through the Plone Control Panel under Types.

Although you may enable the File type to use versioning, the only changes that are tracked are those items actually describing the File (for example, Title, Description, and so on). The changes to the contents of the File are not tracked.

Creating a new version

Versions are created each time you save your content. Note that there is a Change note field at the bottom of the Edit page for content items with versioning enabled:

The information entered in the Change note field will be stored along with other versioning information, which you are able to view through the History tab.

Viewing the version history

You can view the list of all of the versions of a content item by clicking on the History tab for that content item. In the History view that you can see in the following screenshot, the most recent version is listed fi rst. Clicking on any of the column headers will re-sort the listing based on that column heading.

The most current version is always labeled Working Copy in the History view.

Previewing previous versions

To preview a specific version, simply click the preview link of the desired revision. In the following example, revision 3 has been identified, and will be displayed if this link is clicked:

On the subsequent page, you may either click on the jump down link to the point of the content preview:

Comparing versions

From the History view, you can compare any version with the previous version by using the Compare to the previous revision link in the Actions column. You can also compare any previous version with the current version by using the Compare to current revision link.

In the following example, the previous version of the page (revision 7) is being compared to the current version of the page (revision 8):

This comparison view will color-code the following types of changes between versions:

Content added

Content deleted

HTML tags added

HTML tags deleted

Content changes

In the above example, the first paragraph (highlighted in the left column) was actually moved farther down the page (highlighted in the right column). Note how changes to HTML tags are indicated by the colored labels delete and insert.

If you are familiar with HTML, the Show code differences link provides an alternative view of the changes. The following is a screenshot of the code (or HTML) differences view, comparing the two revisions after clicking on the Show code differences link:

Note how the position of the text in this view refl ects the actual location of where the text was in revision 7 (left column), and where the text is currently located in revision 8 (right column).

Reverting to a previous version

One of the most useful aspects of versioning is the ability to revert to a previous version. After using the preview links to verify that you have found the version you want to make the new current version, simply click on that version's Revert to this revision link:

Clicking on the Revert to this revision link for Revision 8 will create a new version of the content item. This new version will be identical to Revision 8:

You will also notice that there is now a new revision in the History:

The Comment column is automatically updated to indicate that the most recent version was created from reverting to Revision 8.

Summary

In this article, we have seen what a powerful tool versioning is, for managing each saved version of a content item. In particular, we learned:

Alerts & Offers

Series & Level

We understand your time is important. Uniquely amongst the major publishers, we seek to develop and publish the broadest range of learning and information products on each technology. Every Packt product delivers a specific learning pathway, broadly defined by the Series type. This structured approach enables you to select the pathway which best suits your knowledge level, learning style and task objectives.

Learning

As a new user, these step-by-step tutorial guides will give you all the practical skills necessary to become competent and efficient.

Beginner's Guide

Friendly, informal tutorials that provide a practical introduction using examples, activities, and challenges.

Essentials

Fast paced, concentrated introductions showing the quickest way to put the tool to work in the real world.

Cookbook

A collection of practical self-contained recipes that all users of the technology will find useful for building more powerful and reliable systems.

Blueprints

Guides you through the most common types of project you'll encounter, giving you end-to-end guidance on how to build your specific solution quickly and reliably.

Mastering

Take your skills to the next level with advanced tutorials that will give you confidence to master the tool's most powerful features.

Starting

Accessible to readers adopting the topic, these titles get you into the tool or technology so that you can become an effective user.

Progressing

Building on core skills you already have, these titles share solutions and expertise so you become a highly productive power user.