Actions

Difference between revisions of "Module chrome"

From Joomla! Documentation

(What is Module chrome?)
(What is Module chrome?)
Line 10: Line 10:
  
 
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!
 
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!
 +
 +
{| style="width:100%" border="1"
 +
! Style
 +
! Output
 +
! width="204" | Appearance
 +
|-
 +
| '''rounded'''
 +
(default for menus on milkyway)
 +
| <source lang="html4strict">
 +
  <div class="module_menu">
 +
    <div>
 +
      <div>
 +
        <div>
 +
          <h3>Main Menu</h3>
 +
          <ul class="menu">
 +
            <!-- various menu items -->
 +
          </ul>
 +
        </div>
 +
      </div>
 +
    </div>
 +
  </div>
 +
  </source>
 +
|[[Image:Rounded.png]]
 +
|-
 +
| '''none'''
 +
| <source lang="html4strict">
 +
  <ul class="menu">
 +
    <!-- various menu items -->
 +
</ul>
 +
  </source>
 +
|[[Image:None.png]]
 +
|}
  
 
<noinclude>[[Category:Advanced]]</noinclude>
 
<noinclude>[[Category:Advanced]]</noinclude>

Revision as of 17:40, 17 January 2008

What is Module chrome?

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 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 is used 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!

Style Output Appearance
rounded

(default for menus on milkyway)

  <div class="module_menu">
    <div>
      <div>
        <div>
          <h3>Main Menu</h3>
          <ul class="menu">
            <!-- various menu items -->
          </ul>
        </div>
      </div>
    </div>
  </div>
File:Rounded.png
none
  <ul class="menu">
    <!-- various menu items -->
</ul>
File:None.png