Establishing the Listing Construction

Step one in constructing a Joomla! element is to arrange the essential listing construction and information to help it. There’s a /elements listing situated within the root Joomla set up folder. This folder incorporates information and different folders pertaining to the entrance finish (what website online guests see) of your element. Additionally situated within the root folder of your Joomla! set up is a folder setup like this: /administrator/elements. That is the folder the place your again finish administration information and folders go. The naming conference used for the folder the place a Joomla! element truly exists is com_mycomponent, the place mycomponent is the identify of the element.

When the element is known as from the backend or from the entrance finish, the Joomla framework routinely seems for a singular .php file named after the element. An instance will assist illustrate this setup:

If I have been creating a mortgage calculator (mortcalc), I might use the next listing setup

[joomla_installation]/elements/com_mortcalc/mortcalc.php

[joomla_installation]/administrator/elements/com_mortcalc/mortcalc.php

Registering Your Element within the Joomla! Database

To create entry to your element from the Joomla! administrator navigation menus, that you must register the element within the Joomla database. That is achieved by making an entry within the jos_components desk. Should you setup your Joomla! database in order that it makes use of a desk prefix aside from jos_, your elements desk identify will clearly be barely totally different. The pertinent fields from that desk, which you will have to specify when making your element entry, are identify, hyperlink, admin_menu_link, and choice. These fields arrange the Joomla! inner navigation on your element in order that it may be referenced from the Elements menu and in order that it may be linked to on the frontend from a Joomla! menu utilizing the usual element hyperlink.

After you might have executed the SQL (both with an SQL assertion or utilizing a graphical interface) to register your element, you’ll then see it listed underneath the Elements menu of the Joomla! administrator part. The worth you entered within the identify area would be the identify that exhibits up on the Elements menu.

Shifting Ahead

With these two steps behind you, all that is left to do is code the performance of your Joomla! element, proper? Clearly there’s loads of work forward now that you’ve got arrange the essential construction. To benefit from your element and the Joomla! extension framework, you need to familiarize your self with the Joomla! extension courses. Joomla! supplies class buildings and a improvement framework that simplify performing such duties as creating toolbars, dealing with the logic between your database, the administrator setup, and offering a helpful expertise for finish customers of your element.