How to register a component in the Joomla database

November 27, 2010

Reading time ~1 minute

Unlike modules and templates which can be “dropped” into place and Joomla will just find them, components need to be registered in the components table. This is a pain to do so here a quick solution. We just need to create three files, mostly copy-pasted from the code below.

First create an tiny index.html file with the following code:


Next, create an empty file called example.php.

Lastly, create a file called example.xml with the following code:

<?xml version="1.0" encoding="utf-8"?>
<install type="component" version="1.5.22" method="upgrade">
 <author>Andrew Eddie</author>
 <copyright>Copyright 2010 New Life in IT Pty Ltd. All rights reserved.	</copyright>
 <license>GNU General Public License version 2 or later.</license>
 <description>Example description</description>



  <menu img="components/com_example/media/images/example_16x16.png"
   <menu img="components/com_example/media/images/sd_16x16.png"
   <menu img="js/ThemeOffice/categories.png"

That’s your basic set of files for creating dual frontend and backend component with categories support. To turn this into your own component, all you need to do is replace com_example with the name of the folder that you will use for your own component and change the names of the file to match you component. For example, if you are going to create a component called “Weather” then your component folder might be com_weather and you’ll use a weather.php and a weather.xml file. Then just zip those three files up and install them. It will install and register the component in your testing site for you to continue working.

More things to do

If you don’t need the categories support, or are managing your component’s submenu manually, remove the <submenu> tag.

If you don’t need a frontend component, remove the <files> tag after the <description> tag.

Change the value of the img attribute to match where you are putting the icon for your component.

If you are using source control (like Subversion) and you are working locally, once you have installed the basic extension, you can delete the folders and soft-link them back to you code repository files (not available on Windows platforms).

Advanced Test Driven Development for Node - Part 1

Part 1 of my attempt to port Robert C. Martin's talk '8LU:Advanced Concepts in TDD' to Node. Continue reading

Semantic versioning for retail software

Published on December 11, 2014

Better Grunt files (for organised developers)

Published on December 02, 2014