Using Content History in your Component

From Joomla! Documentation

Revision as of 12:49, 2 November 2013 by Dextercowley (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In version 3.2, Joomla added the ability to track content history (also called versions) for all core components. This allows you to view and restore from prior versions of an article, banner, category, and other content types. This feature can easily be added to third-party components. This tutorial shows you how to do this. We will illustrate this by adding content history to an example component.

Important Note: This tutorial assumes that the component uses a JTable sub-class for the "CRUD" operations. If your component does not use JTable then the simplest thing to do is to re-work your component to use JTable's store() and delete() methods. If you do that, you will be able to use the methods described in this tutorial.

Set up Working Environment

Add Rows to Content Types Table

Add Component Level Options

Update Content History During Table Save and Delete

Add Versions Button to Tool Bar

Add Version Note Field to Form

Add Labels to Pop-Up Windows

Update Extension SQL Files