How to change the module output in Joomla
Thursday, 26 January 2012 14:10
In Joomla, the module output is controlled through the Module Chrome and the file templates/system/html/modules.php. When you insert a module position inside your template index.php file, you usually define a style for it.
For example:
In the above example the style you have defined is xhtml. This means that Joomla will look into the file templates/system/html/modules.php to find the Module Chrome modChrome_xhtml. This Module Chrome defines the module output structure.
However you can override this Module Chrome if there is a file modules.php inside templates/your_template/html/. In this file you can redefine a Module Chrome modChrome_xhtml so that you can override the default one in templates/system/html/modules.php.
You can also create a new custom Module Chrome. For example let's create a new Module Chrome with the name minitek. In this case the module include inside the file index.php of your template should be:
The module style in the above example is minitek. Now we must define a Module Chrome modChrome_minitek inside the file modules.php.
Open the file templates/your_template/html/ and insert this new function: (Create this file if it does not exist)
You see that the function name is modChrome_minitek because we have defined the style minitek in the module include.
Now you can customize the above code, for example you can change the ordering of the html elements or add new ones. You can change the h3 tag to a h2 for example or make any customizations you like.
In the above example the style you have defined is xhtml. This means that Joomla will look into the file templates/system/html/modules.php to find the Module Chrome modChrome_xhtml. This Module Chrome defines the module output structure.
However you can override this Module Chrome if there is a file modules.php inside templates/your_template/html/. In this file you can redefine a Module Chrome modChrome_xhtml so that you can override the default one in templates/system/html/modules.php.
You can also create a new custom Module Chrome. For example let's create a new Module Chrome with the name minitek. In this case the module include inside the file index.php of your template should be:
The module style in the above example is minitek. Now we must define a Module Chrome modChrome_minitek inside the file modules.php.
Open the file templates/your_template/html/ and insert this new function: (Create this file if it does not exist)
You see that the function name is modChrome_minitek because we have defined the style minitek in the module include.
Now you can customize the above code, for example you can change the ordering of the html elements or add new ones. You can change the h3 tag to a h2 for example or make any customizations you like.
Read 1805 times
Published in
Templates Tutorials
Tags
No comments:
Post a Comment