Templates 如何在Joomla 3.0中解决此模块样式问题
我有这样一个CSS类: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
.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
旁边。最好用正确的方法操作,您还可以使用其他模板