Actions

Difference between revisions of "Applying custom module chrome"

From Joomla! Documentation

m
(Applying custom Module chrome)
Line 11: Line 11:
 
The function should echo the $module->content, wrapped in whatever chrome is required.  To see how this is done look at the code for the standard Module chromes in [path-to-Joomla!]/templates/system/html/modules.php.
 
The function should echo the $module->content, wrapped in whatever chrome is required.  To see how this is done look at the code for the standard Module chromes in [path-to-Joomla!]/templates/system/html/modules.php.
  
Note that this makes it possible to pass parameters from the <jdoc:include> into the Module chrome function.  See: [[jforum:115953]]
+
Note that this makes it possible to pass parameters from the <jdoc:include> into the Module chrome function.  See: [[jtopic:115953]]
 
<noinclude>[[Category:Advanced]][[Category:Modules]][[Category:Templates]][[Category:Topics]]</noinclude>
 
<noinclude>[[Category:Advanced]][[Category:Modules]][[Category:Templates]][[Category:Topics]]</noinclude>

Revision as of 12:02, 20 January 2008

Applying custom Module chrome

To define custom Module chrome in your template you need to create a file called modules.php in your template html directory. For example, this might be [path-to-Joomla!]/templates/my_template/html/modules.php.

In this file you should define a function called modChrome_style where "style" is the name of your custom Module chrome. This function will take three arguments:

  • the module object;
  • a reference to the Module parameters array;
  • a reference to the Module attribute array.

The function should echo the $module->content, wrapped in whatever chrome is required. To see how this is done look at the code for the standard Module chromes in [path-to-Joomla!]/templates/system/html/modules.php.

Note that this makes it possible to pass parameters from the <jdoc:include> into the Module chrome function. See: jtopic:115953