Applying custom module chrome
From Joomla! Documentation
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/TEMPLATE_NAME/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, $module, &$params, and &$attribs, as shown:
<?php
function modChrome_STYLE( $module, &$params, &$attribs )
{
/* chromed Module output goes here */
}
?>
Custom chrome attributes
It is also possible to pass further attributes into the Module chrome function using the same
<?php
function modChrome_custom( $module, &$params, &$attribs ) {
if (isset( $attribs['headerLevel'] ))
{
$headerLevel = $attribs['headerLevel'];
} else {
$headerLevel = 3;
}
if (isset( $attribs['background'] ))
{
$background = $attribs['background'];
} else {
$background = 'blue';
}
echo '<div class="' .$params->get( 'moduleclass_sfx' ) .'" >';
if ($module->showtitle)
{
echo '<h' .$headerLevel .'>' .$module->title .'</h' .$headerLevel .'>';
}
echo '<div class="' .$background .'">';
echo $module->content;
echo '</div>';
echo '</div>';
}
?>
To define custom Module chrome in your template you need to create a file called modules.php in your template html directory.
ReplyDeletePHP Developer India