Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Templates 如何在Joomla 3.0中解决此模块样式问题_Templates_Joomla_Module_Styles_Joomla Extensions - Fatal编程技术网

Templates 如何在Joomla 3.0中解决此模块样式问题

Templates 如何在Joomla 3.0中解决此模块样式问题,templates,joomla,module,styles,joomla-extensions,Templates,Joomla,Module,Styles,Joomla Extensions,我有这样一个CSS类: .divTourCategorySummaryBoxLeft, .divTourCategorySummaryBoxRight { width: 98%; min-height: 350px; border: 1px dashed #9CAAC6; padding: 2px; margin-bottom:3px; background: #DEE7EF; color: #000063; line-height

我有这样一个CSS类:

.divTourCategorySummaryBoxLeft, .divTourCategorySummaryBoxRight {
    width: 98%;
    min-height: 350px;
    border: 1px dashed #9CAAC6;
    padding: 2px;
    margin-bottom:3px;
    background: #DEE7EF;
    color: #000063;
    line-height: 1.4em;
    display:block;
    overflow:auto;

}
     <jdoc:include type="modules" name="modTourCategorySummaryLeft" style="customstyle" />
然后我在index.php中包含如下模块:

<div class="divTourCategorySummaryBoxRight">
    <jdoc:include type="modules" name="modTourCategorySummaryRight" />
</div>

这看起来很完美。但是,我需要在同一页面上有多个模块。因此,当我添加另一个模块时,它出现在同一个div中。这不是我想要的方式。对于每个模块,必须有一个单独的div。模块的数量未知

所以我试了一下:

<jdoc:include type="modules" name="modTourCategorySummaryLeft" style="divTourCategorySummaryBoxLeft" />

但是这里的造型失败了。如何让它为每个模块显示一组新的div

请告知

这是我自己的模板,我从零开始构建,查看joomla文档。我对这个很陌生。
谢谢

您需要创建一个新的
模块chrome
。在模板html文件夹中,创建名为
modules.php
的文件

在里面,做一个这样的函数

defined('_JEXEC') or die;

function modChrome_customstyle($module, &$params, &$attribs)
{
    if (!empty ($module->content)) : ?>
            <div class="divTourCategorySummaryBoxRight">
                 <div class="moduletable">
                      <?php if ($module->showtitle != 0) : ?>
                           <h3><?php echo $module->title; ?></h3>
                      <?php endif; ?>
                      <?php echo $module->content; ?>
                 </div>
            </div>
    <?php endif;
}
定义(“JEXEC”)或模具;
函数modChrome_customstyle($module,&$params,&$attribs)
{
如果(!empty($module->content)):?>

你的代码对我来说很有意义,但我没有我的结构我没有一个模板/system/html文件夹。我缺少什么吗?我在index.php文件中包含了这个函数,它似乎可以工作。这可以吗,或者这会给我带来问题。当然,我已经定义了一个(…)检查完成。
system/html
不在您的模板文件夹中,而是在
root/templates/system
中,就在
root/templates/yourtemplate
旁边。最好用正确的方法操作,您还可以使用其他模板