Chunk

Difference between revisions of "Module chrome"

From Joomla! Documentation

m (clean up)
(Marked this version for translation)
Line 1: Line 1:
 
<languages />
 
<languages />
 
<translate>
 
<translate>
 +
<!--T:1-->
 
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 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.
  
 +
<!--T:2-->
 
Module chrome is determined by using the '<tt>style</tt>' attribute in the statement calling the module.  For example, the following statement may be used in the <tt>index.php</tt> file of a template to insert the Modules in the '<tt>user1</tt>' position and apply the '<tt>custom</tt>' Module chrome:
 
Module chrome is determined by using the '<tt>style</tt>' attribute in the statement calling the module.  For example, the following statement may be used in the <tt>index.php</tt> file of a template to insert the Modules in the '<tt>user1</tt>' position and apply the '<tt>custom</tt>' Module chrome:
 
<source lang="php">
 
<source lang="php">
Line 9: Line 11:
 
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. '<tt>user1</tt>' and '<tt>user2</tt>').
 
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. '<tt>user1</tt>' and '<tt>user2</tt>').
  
 +
<!--T:3-->
 
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!<noinclude>[[Category:Glossary definitions|{{PAGENAME}}]]</noinclude></translate>
 
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!<noinclude>[[Category:Glossary definitions|{{PAGENAME}}]]</noinclude></translate>

Revision as of 13:01, 24 February 2014

Other languages:
Bahasa Indonesia • ‎Deutsch • ‎English • ‎Kiswahili • ‎Nederlands • ‎català • ‎español • ‎français • ‎italiano • ‎български • ‎русский • ‎中文(台灣)‎ • ‎日本語

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 a 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!