countModules & php help needed - Joomla! Forum - community, help and support
i've taken free template , first time learnign countmodules. although i've put templates before they've ever been simple.
on template i've been racking brains trying change way sidebar works , can't work out! far i've proved adept @ screwing template up...
here's i'm starting with:
as see code saying if there content in sidebar ('left') or search ('search') display sidebar, else display component area. 'left' 1 sole area, whereas want split 6 identifiable areas can place module , hence, if 1 of them has content want sidebar displayed.
i know it's changing
, returning '0' or non '0' result ..e.g. try might can't there.
can me this?
thanks,
richard
on template i've been racking brains trying change way sidebar works , can't work out! far i've proved adept @ screwing template up...
here's i'm starting with:
code: select all
<div id="mainrow" class="row clearfix">
<?php if($this->countmodules('left') or $this->countmodules('search')) : ?>
<div id="main" role="main" class="mainleft last clearfix">
<jdoc:include type="message" />
<jdoc:include type="component" />
</div>
<aside id="sidebar" class="clearfix" role="complementary">
<?php if($this->countmodules('left')) : ?>
<div id="left" class="clearfix">
<jdoc:include type="modules" name="left" style="html5"/>
</div>
<?php endif; ?>
<?php if($this->countmodules('search')) : ?>
<div id="search" role="search">
<jdoc:include type="modules" name="search" style="html5" />
</div>
<?php endif; ?>
</aside>
<?php else : ?>
<div id="main" role="main" class="main last clearfix">
<jdoc:include type="message" />
<jdoc:include type="component" />
</div>
<?php endif; ?>
</div>
as see code saying if there content in sidebar ('left') or search ('search') display sidebar, else display component area. 'left' 1 sole area, whereas want split 6 identifiable areas can place module , hence, if 1 of them has content want sidebar displayed.
i know it's changing
code: select all
<?php if($this->countmodules('left')code: select all
<?php if($this->countmodules('left')) : ?>code: select all
<?php if ($leftmodules > 0) : ?>can me this?
thanks,
richard
i think might going wrong way. have code in template says if there's module in left column, display it. if have 6 different modules display in left column, use entensions > module manager specifiy modules display on pages.
Comments
Post a Comment