Difference between revisions of "Extension types (technical definitions)"

From Joomla! Documentation

(Importing text file)
 
(Corrected list and italics markup. Edited some punctuation and text for clarity.)
Line 1: Line 1:
===== What Are Extensions? =====
+
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
 +
* Plug-ins – 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
  
There are five types of extensions that can be written for a Joomla! website:
+
=== Templates ===
  * Templates
+
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
 
  * Plug-ins ("mambots" in Joomla! 1.0.x)
 
  * Components
 
  * Languages
 
  
Each type of extension is unique in what it does.
+
=== Modules ===
 +
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.
  
==== Templates ====
+
=== Plug-Ins ===
 +
There are four types of plug-ins.
 +
* Content
 +
* Search
 +
* Editors
 +
* Editor Extensions
  
A template is a collection of at least two files consisting primarily of a main PHP script and a cascaded style sheet (CSS). The PHP script mainly defines the layout of the site, which can be made to vary depending on what is selected from the site's menus. PHP is interlaced with HTML in this file with the HTML providing the raw elements that define what goes where and the PHP defining 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 at desired places within the HTML elements. The CSS file defines text and background colors, graphics, and other attributes of the various elements that can appear on any given page rendered by the template. The objective of using a CSS file to define "styles" is to give the site a consistent look and behavior. [[http://htmlhelp.com/reference/css/|You can read about cascaded style sheets here]].
+
A content plug-in, for instance, gets called by the core code when articles are displayed and searches for special text strings processed specifically by that plug-in, 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 plug-in can extend the site search capability to include content in non-native components.
  
==== Modules ====
+
An editor plug-in can completely define or extend an existing content text editor. (For example, JCE.)
  
A module is the simplest type of extension. It's purpose is to provide a very 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, often multiple times each, and 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 (this is specified on a per-module basis). Some example modules are login, online users, visit counter, and Newsflash.
+
=== Components ===
 
+
A component is the most elaborate and complex type of Joomla! extension. It can have both a front end (user) and back end (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.
[[modules:hello_world|Click here for an example of a very basic module called "Hello World"]].
 
 
 
 
 
==== Plug-Ins ====
 
 
 
There are four different types of plug-ins:
 
  * Content
 
  * Search
 
  * Editors
 
  * Editor Extensions
 
 
 
A content plug-in, for instance, gets called by the core code when articles are displayed and searches for special text strings processed specifically by that plug-in, replacing them with other text (which can include HTML, Javascript, etc.). 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 plug-in can extend the site search capability to include content in non-native components. An editor plug-in can completely define or extend an existing content text editor (e.g., JCE).
 
 
 
==== Components ====
 
 
 
A component is the most elaborate and complex type of Joomla! extension. It can have both a front end (user) and back end (admin) interface, and can be made to do many different things. 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 it to be. Some examples include photo galleries, discussion forums, and guest books.
 
 
 
 
 
==== Languages ====
 
  
 +
=== Languages ===
 
A language is a collection of one or more files that define elements of a specific language that your extension supports.
 
A language is a collection of one or more files that define elements of a specific language that your extension supports.
  
==== Common Attributes ====
+
=== Common Attributes ===
 
 
 
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.
 
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, so 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, etc.) and how it should be installed.
+
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.
 
 
  * [[modules:xml_installfile|Click here for an example XML file for a module]]
 
  * [[plugins:create_plugin|Click here for an example XML file for a plugin]]
 
  * [[languages:xml_installfile|Click here for an example XML file for a language pack]]
 
  
 
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.
 
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.
 
+
[[Category:Tutorials]]
  * [[components:xml_installfile|Click here for an example XML file for a component]].
 
 
 
==== Summary ====
 
 
 
  * 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
 
  * Plug-ins - 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
 

Revision as of 17:36, 27 December 2010

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
  • Plug-ins – 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.

Plug-Ins[edit]

There are four types of plug-ins.

  • Content
  • Search
  • Editors
  • Editor Extensions

A content plug-in, for instance, gets called by the core code when articles are displayed and searches for special text strings processed specifically by that plug-in, 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 plug-in can extend the site search capability to include content in non-native components.

An editor plug-in 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 front end (user) and back end (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.