Drupal: .htaccess Access Deny
August 21, 2014 – 7:59 am | No Comment

In this article I will tell how to forbid access to certain resources for some clients. The instructions will include descriptions of different directives.

Read the full story »
CSS Templates

Contain reviews and news about CSS Templates.

Freebies

Contain freebies such as icons, graphics, headers and images for your websites.

Fun Stuff

Contains other fun stuff for entertainment or interesting site showcase.

How-To

Contain technical elaborations on some specific workarounds or common tweak.

Joomla Templates

Contains reviews and news about Joomla templates.

Home » How-To

Joomla Components and Modules

Submitted by on December 10, 2009 – 12:23 pmNo Comment

New Joomla users often have a problem when defining “Component” and “Module” terms. But once difference between these two terms becomes clear understanding of Joomla architecture becomes more exact as well. So, what is the difference between module and component?

There is the simple answer: module can appear on any page and has a quite simple structure. While component is loaded on its own page and as a rule has more difficult structure.

This answer is quite enough to bate one’s curiosity. And if you need more detailed answer, let’s begin from the description of how Joomla loads pages.

When somebody enters your site, he runs index.php file from Joomla folder. This file loads different classes and other code elements which allow Joomla working. After this Joomla finds folder of the current template and tries to load index.php from there. So, index.php file is contained in the root folder as well as in the template folder and root index.php loads index.php for template.

index.php for template usually looks like a typical HTML file. You will find the following string there:

<?php include_once(‘mainbody.php’); ?>

This string pauses recording of HTML strings and launches code from mainbody.php which loads one component. This means that every Joomla page loads a component. (You can remove this string. In this case Joomla will not loading of components and your site will lose a lot of its functionality). By default Joomla will load a component correlated with the first menu item. Usually it is ‘Home’ which indicates to the ‘frontpage’ component. As a rule it contains links to news articles. As soon as you click the link, ‘content’ component will be loaded together with the article. Other links load other components.

In addition to the mainbody.php template contains calls of mosLoadModules() functions, for example mosLoadModules(‘left’);.This function loads all modules attached to the current component to the left of the screen (by default the screen is divided into the following areas: left, top, bottom, inset, user1, user2). After making module configurations the select list will appear in the Joomla back-end allowing to attach this module to some components. There is no need to use templates for loading of modules to all positions. But they will be useful for loading at least one module and leave some place for menu until you’ll set its location. Usually users of your site are not worried about difference between module and component. Nevertheless site administrators should know how to control these elements. Modules are installed/uninstalled in modules submenu.

If you click the ‘Manage Modules’ item another list will appear providing options of publishing/unpublishing, positioning and location. This list can be longer than the first one because of user modules. These modules are stored in database as articles. But in other respects they don’t differ from the rest of modules.

All modules can have some parameters. This allows to change module settings without creating a complex interface for site administrators. For example, if a developer wishes to give administrator ability to change module background he can add the respective parameter to module management. Administrator will click header of the module and will be able to enter, for example, backgroundcolor = green to the ‘Parameters’ table.

Development of administrative side of a component requires for considerable time costs. But the result is easy to use interface. When loading component’s administrative side, admin.[component_name].php file is executed from /administrator/components/ folder.

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.