Difference between revisions of "Module chrome"

From Joomla! Documentation

m (1 revision(s))
m (Reverted edits by Isidrobaq (talk) to last revision by Tom Hutchison)
(35 intermediate revisions by 9 users not shown)
Line 1: Line 1:
===== What is Module chrome? =====
<noinclude><languages /></noinclude>
{{Chunk:Module chrome/en}}
The output from Modules can be wrapped in a number of predefined standard ways, or it can be wrapped in a template-dependent custom manner.  This wrapping is known as Module chrome.  CSS styling can then be applied to the wrappers to give the template designer a great deal of flexibility in styling the module output.
'''See also:''' [[Standard Module Chromes]]
[[Category:Module Development]]
[[Category:Template Development]]

Latest revision as of 12:22, 5 March 2014

Other languages:
català • ‎English • ‎español • ‎français • ‎Bahasa Indonesia • ‎日本語 • ‎Nederlands • ‎Kiswahili

Module chrome allows template designers to have a certain amount of control over the way the output from a Module is displayed in their template. Essentially, it consists of a small amount of predefined HTML which is inserted before, after, or around the output from each module, and which can then be styled using CSS. Module chrome is commonly used to provide borders around modules, especially with rounded corners, but it can be used for much more than that.

Module chrome is determined by using the 'style' attribute in the statement calling the module. For example, the following statement may be used in the index.php file of the currently assigned as main template to insert the Modules in the 'user1' position and apply the 'custom' Module chrome:

<jdoc:include type="modules" name="user1" style="custom" />

It can be seen that the same Module chrome is applied to every Module in that position - in other words, if you want to have two Modules in a column, but want them to have different Module chrome, then they would need to be set up as two different 'positions' (e.g. 'user1' and 'user2').

The standard Joomla! 1.5+ package includes six default Module chrome styles. However, the flexibility of the template system means that you are not limited to these styles - it's very easy to create as many new styles as you want!

See also: Standard Module Chromes