Extension types (technical definitions)

From Joomla! Documentation

Revision as of 16:58, 18 June 2019 by Sandra97 (talk | contribs) (Marked this version for translation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Other languages:
Deutsch • ‎English • ‎français • ‎italiano

There are five types of extensions available for a Joomla! Website.

  • Templates – define the look, feel, and navigation capabilities of your site
  • Modules – data already exists and you just want a new way to present it on your site
  • Plugins – data, content, or custom functions replace information in articles or functions extend core features
  • Components – add custom functions to your site that can be selected from menus
  • Languages – define additional languages for your site

Templates[edit]

A template is a collection of at least two files consisting primarily of a main PHP script and a cascading style sheet (CSS). The PHP script defines the layout of the site that can vary depending on what is selected from the site's menus. PHP is interlaced with HTML in this file. The HTML provides the raw elements that define what goes where and the PHP defines the logic that can make the content different based on the menu item selected as well as invoking core Joomla! methods to insert articles, modules, and other content within the HTML elements. The CSS file defines text and background colors, graphics, and other attributes of the various elements that can appear on a page. The CSS file gives the site a consistent look and behavior.

Modules[edit]

A module is the simplest type of extension. It provides a specific type of information that can be inserted into your site template and appear on your pages wherever your template supports inserting content. Modules can be instantiated as often as necessary. Each instance can be placed at a specific position on the page as defined in the template. Positions are defined in the site template's XML file and allow modules to appear only when certain menu items are selected. Some example modules are login, online users, visit counter and Newsflash.

Plugins[edit]

There are many types of plugins, some examples are:

  • Content
  • Search
  • Editors
  • Editor Extensions

A content plugin, for instance, gets called by the core code when articles are displayed and searches for special text strings processed specifically by that plugin, replacing them with other text (which can include HTML, Javascript and so on.). For example, a plugin might process the string {avatar} and insert a reference to the avatar uploaded or selected by a user on a site equipped with the popular Community Builder component or replace {video=path-to-video} with javascript that streams video content to the user's browser.

A search plugin can extend the site search capability to include content in non-native components.

An editor plugin can completely define or extend an existing content text editor. (For example, JCE.)

Components[edit]

A component is the most elaborate and complex type of Joomla! extension. It can have both a frontend (user) and backend (admin) interface. Components can have one or more ways to have features inserted as items in site menus, and the admin interface can be as elaborate as the author chooses. Some examples include photo galleries, discussion forums and guest books.

Languages[edit]

A language is a collection of one or more files that define elements of a specific language that your extension supports.

Common Attributes[edit]

All Joomla! extensions include source code files and an XML file at a minimum. For all extension types, the XML file acts as an installation script. For some extension types, it also provides a specification for the administrator interface.

The admin interface for modules and plug-ins is completely coded in XML. There is no dynamic element to it and no real way to customize the look and feel of the parameter input part. That part is handled by the Joomla! core. The XML file also describes the extension (name, date, version, description and so on) and how it should be installed.

This is in contrast to the admin interface for a component, whose XML file is used only for installation and to define the component's administrator menu. A component is typically coded entirely in PHP and HTML by its author. There are distinct parts to a component and they are divided between the user and admin interfaces. The admin portion includes a menu, action handler, and visual components which can include forms and other input elements. The user portion has no menu component, but is otherwise very similar to the admin portion.