让joomla模块跨越多个列 [英] Make joomla module span multiple columns

查看:96
本文介绍了让joomla模块跨越多个列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的网页在Joomla 1.5上运行,而且首页目前有一个3我可以放置模块的列/位置布局。

然而,我想要一个跨越两个最右边位置的模块,同时将模块保持在正常的三列布局。即这是我想要的样子:
$ b $ [MODULE] [------- MODULE ------]



[MODULE] [MODULE] [MODULE]



[p] [MODULE] [MODULE]



我的猜测是我需要定义一个跨越两列的新位置。是这样吗?如果我想确保新的,更宽的模块下方的模块仍然处于常规布局状态,我该怎么做?



谢谢!

解决方案

是的,这可以在模板中完成,例如使用countmodules()来查看是否要显示位置并相应地排列位置,例如,以下显示了如何根据模块是否放置在正确列中来使页面具有一列或两列。如果右列中有一个模块,则会显示两个div(用于调整大小的css),如果右列中没有任何内容,则会显示全宽主列。

 <?php if($ this-> countModules('right')):?> 
< div id =divMainContent>
< jdoc:include type =modulesname =user9style =xhtml/>
< jdoc:include type =component/>
< jdoc:include type =modulesname =bottombannerstyle =xhtml/>
< / div> <! - end maincontent - >
< div id =divRight>
< jdoc:include type =modulesname =rightstyle =xhtml/>
< jdoc:include type =modulesname =bannerstyle =xhtml/>
< / div>
<?php else:?>
< div id =divMainContentWide>
< div id =divTopWide>
< jdoc:include type =modulesname =user9style =xhtml/>
< / div>
< / div>
<?php endif; ?>


I've been searching the web and here for an answer to my question, without avail.

My webpages runs on Joomla 1.5 and the frontpage currently has a 3 column/position layout where I can put modules.

However, I would like a module which spans the two rightmost positions, whilst keeping the modules below them in the regular "three-column layout". I.e. this is how I want it to look:

[MODULE][-------MODULE------]

[MODULE][MODULE][MODULE]

[MODULE][MODULE][MODULE]

My guess is that I need to define a new position that spans the two columns. Is that the case? How do I do it if I want to make sure the modules below the new, wider, module are still in their regular layout?

Thanks!

解决方案

Yep, this can be done in the template, e.g. use countmodules() to see if a position is to be displayed and arrange the positions accordingly, e.g. the following shows how to have a page that can either have one column or two based on if a module is placed into the "right" column. If there is a module in the "right" column then two divs are displayed (css used to size them) and if there is nothing in the right column a full width main column is displayed instead.

<?php if($this->countModules('right')) : ?>
<div id="divMainContent">
    <jdoc:include type="modules" name="user9" style="xhtml" />
    <jdoc:include type="component" />
    <jdoc:include type="modules" name="bottombanner" style="xhtml" />
</div> <!-- end maincontent -->
<div id="divRight">
    <jdoc:include type="modules" name="right" style="xhtml" />
    <jdoc:include type="modules" name="banner" style="xhtml" />
</div>
<?php else: ?>
    <div id="divMainContentWide">
        <div id="divTopWide">
            <jdoc:include type="modules" name="user9" style="xhtml" />
        </div>
    </div>
<?php endif; ?>

这篇关于让joomla模块跨越多个列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆