Joomla 2.5模板的jdoc样式值

时间:2013-04-15 06:43:23

标签: html5 joomla joomla-template

我正在Joomla 2.5中创建一个HTML5模板,我想知道下面代码中style属性的选项是什么?

<jdoc:include type="modules" name="top" style="???" />

1 个答案:

答案 0 :(得分:3)

打开templates\system\html\modules.php。有定义的系统样式,如xhtmlrounded等。您还可以看到代码如何呈现每种样式。

如果要添加自己的样式,则需要创建新的module chrome。在您的模板html文件夹(不是系统,不要编辑上面的文件)中,创建名为modules.php的文件。

在里面,制作一个这样的功能

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;
}

这样您就可以创建自定义模块输出,只需按照您想要的方式编辑代码。

然后,在您的模板文件中,包含带

的模块
     <jdoc:include type="modules" name="top" style="mystyle" />
相关问题