| home / authoring / style / sheets / joomla_templates3 |
|
|
When a module is called in the index.php, it has several options on how it is displayed.
The syntax is
<jdoc:include type="modules" name="LOCATION" style="OPTION" />
The style is optional and is defined in templates/system/html/modules.php. Currently, the default modules.php file contains the following layouts.
OPTION="table" (default display) modules are displayed in a column. The following shows an example of the output:
OPTION="horz" makes the modules appear horizontal. Each module is output in the cell of a wrapper table. The following shows an example of the output:
OPTION="xhtml" makes modules appear as a simple div element. The following shows an example of the output:
OPTION="rounded" makes modules appear in a format that allows, for example, stretchable rounded corners. If this $style is used, the name of the <div> changes from moduletable to module. The following shows an example of the output:
OPTION="none" makes modules appear as raw output containing no element and no title. Here is an example:
As you can see, the CSS options ((X)HTML and rounded) are much leaner in code, which makes it easier to style the web pages. I don't recommend using suffixes of table (default) or horz unless absolutely needed.
Here's the really good bit!
If you examine the modules.php file, you will see all the options that exist for modules. It's easy to add your own; this is part of the new templating power that is in 1.5.We look at this in more detail in our section on template overrides.
To develop our template, we will put a module style of "xhtml" on all of our modules:
Note that we cannot put these module styles on the <jdoc:include type="component" /> because it is not a module.
In 1.5, the output of modules can be completely customized, or you can use the pre-built output. All these options are called module chrome.
We have also placed the site title inside an <h1> tag. It's more semantically correct and will also help in SEO. Let's also remove the background from the layout divs.
| home / authoring / style / sheets / joomla_templates3 |
URL: