Module Chrome

Module chrome is the way modules are displayed on your site. As we saw in our previous example showing the structure of a template, a module is displayed by adding the following JDOC statement to your template file:

<jdoc:include type="modules" name="topmenu" style="-1"/>

The previous statement displays the raw output of any module assigned to the topmenu position in the Module Manager. Following are the chrome options built into Joomla that are determined by the style parameter. You can use either the names or the corresponding numbers:

none (-1)

Output the raw module content.

table (0)

Output the module in a table. This is the default option.

horz (1)

Output the module as a table inside an outer table.

xhtml (-2)

Output the module in <div> tags.

rounded (-3)

Output the module in nested <div> tags to create rounded corners.

outline

Output the module with a border and usually used to preview module positions.

You can create custom module chrome attributes. Check out the Joomla Documentation wiki at http://docs.joomla.org/Tutorial:More_on_Joomla%21_modules for more information.

You can also customize the appearance of modules by using module class suffixes. See Chapter 9 for more information.

Get Using Joomla now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.