I'm creating an HTML5 template in Joomla 2.5 and I wanted to know what are my options for the style attribute in the code below?
<jdoc:include type="modules" name="top" style="???" />
Open templates\system\html\modules.php
. There are defined system styles, like xhtml
, rounded
etc. You can also see the code how each style will be rendered.
If you want to add your own style, you need to create a new module chrome
. In your template html folder (not system, don't edit above file), create file called modules.php
.
Inside, make a function like this
defined('_JEXEC') or die;
function modChrome_mystyle($module, &$params, &$attribs)
{
if (!empty ($module->content)) : ?>
<div class="moduletable">
<?php if ($module->showtitle != 0) : ?>
<h3><?php echo $module->title; ?></h3>
<?php endif; ?>
<?php echo $module->content; ?>
</div>
<?php endif;
}
This way you can create custom module outputs, just edit the code the way you want.
Then, in your template file, include the module with
<jdoc:include type="modules" name="top" style="mystyle" />