3 minutes reading time (606 words)

The Update Notification System for Extensions

The Update Notification System for Extensions

Since the introduction of Joomla! 2.5, an updates notification system is now available for both Joomla and third-party extensions. In this article we will see how to use the native Joomla updates notification system for all extensions except templates.

Logging in to the administrative side of your website, you will see the two icons for Joomla! and extensions, which will inform you about the current status.

To more easily understand, in this example let's suppose we are working on a system plugin. To use the update notification system we must act on three fronts:

  • the extension manifest (add tags)
  • the manifest update (created from scratch)
  • version numbers

The extension manifest

In the extension manifest file we have to insert the updateserver tag in this way:

<updateservers> 
<server
type="extension"
priority="1"
name="System - Detector">
http://alikonweb.it/update/plg_system_detector_update.xml</server>
</updateservers>

As you can see, the definition of the updateservers tag is very simple, being composed of one or more server tags. If we analyze in detail the server tag, it consists of the following attributes: type, name and priority. Possible values for the type attribute are: (collection,extension). As you may already have noticed, the "collection" is used for Joomla, so for our purpose, the attribute value is "extension". The attribute name must have the same value used in the tag name in the of the extension manifest file. The server tag specifies the URL of the manifest update, i.e. where to find information about the update: version, date, etc. of your extension.

For more information read the official documentation: extension manifest file.

The manifest update file

<updates>
<update>
<name>System - Detector</name>
<element>detector</element>
<client>0</client>
<type>plugin</type>
<folder>system</folder>
<version>1.0.0</version>
<downloads>
<downloadurl type="full" format="zip">
http://alikonweb.it/update/plg_system_detector0.zip
</downloadurl>
</downloads>
<targetplatform name="joomla" version="2.5"/>
</update>
<update>
<name>System - Detector</name>
<element>detector</element>
<client>0</client>
<type>plugin</type>
<folder>system</folder>
<version>1.0.1</version>
<downloads>
<downloadurl type="full" format="zip">
http://alikonweb.it/update/plg_system_detector1.zip
</downloadurl>
</downloads>
<targetplatform name="joomla" version="2.5"/>
</update>
</updates>

Nested in the updates and update tags you can see the close correlation to the tag of the manifest of the extension. The tag name, element and folder must be identical. An important tag is the downloadURL that specifies where to find the package to update the extension.

Version numbers

The method used by Joomla for version numbers is the "PHP-standardized version number strings" as in the current version of Joomla!, which is the major.minor.release 2.5.6. Therefore, for our extensions we must use the same method. In the example above, I've used in the value 1.0.0 for the version tag.

You may have noticed that in the example of the manifest update, there are two update tags. The first refers to version 1.0.0, the second to version 1.0.1, so for every new version of our extension we will add a new occurrence of the update tag to the manifest update file.

How it works

After installing the new "one click update" extension, suppose the version is 1.0.0. Now we have enabled the Joomla! update notification system to work with our extension update too.

Suppose we make a new version of our extension, for example the 1.0.1, to alert all of our extension installations. All we have to do is add a new tag occurrence of the update in the manifest update file.

When you log in as an admin you will see a red number in the icon (the 5 in the top-right) that indicates the number of extensions for which there are available updates. Clicking on it will take you to the Extension Manager menu. Check the extension and click on the update and you're done.

For more information on this refer to the official guide:

0
Post your Haikus for September
 

Comments

Already Registered? Login Here
No comments made yet. Be the first to submit a comment

By accepting you will be accessing a service provided by a third-party external to https://magazine.joomla.org/