Problems with getVar( 'view' ) & collapsible module pos - Joomla! Forum - community, help and support
hi,
i have tried combine getvar( 'view' ) in combination different ways of creating collapsible module positions achieve possibility display article specific module on article pages in category.
the issue need have "general" module position in same column article specific.
the code doesn't work when need have category view component div in "content2" only, e full width. although positions "right" , "articlemodule" both empty, still code <div id="right"></div> generated on page, giving value "content1" component div.
this 1 of ways have coded:
i hope i'm able explain problem in understandable way. quite unexperienced in php coding, suppose have made basic mistake.
any appreciated.
rgds
i have tried combine getvar( 'view' ) in combination different ways of creating collapsible module positions achieve possibility display article specific module on article pages in category.
the issue need have "general" module position in same column article specific.
the code doesn't work when need have category view component div in "content2" only, e full width. although positions "right" , "articlemodule" both empty, still code <div id="right"></div> generated on page, giving value "content1" component div.
this 1 of ways have coded:
code: select all
<?php if($this->countmodules('right or articlemodule')) : ?>
<div id="content1">
<jdoc:include type="component" />
</div>
<div id="right">
<jdoc:include type="modules" name="right" style="xhtml" />
<?php if( jrequest::getvar( 'view' ) == 'article' ): ?>
<jdoc:include type="modules" name="articlemodule" style="xhtml" />
<?php endif; ?>
</div>
<?php else : ?>
<div id="content2"><jdoc:include type="component" /></div>
<?php endif; ?>i hope i'm able explain problem in understandable way. quite unexperienced in php coding, suppose have made basic mistake.
any appreciated.
rgds
try below see if work out you:
code: select all
<?php
$articlemodule = $this->countmodules('articlemodule') == 1 && (jrequest::getcmd('view','') == 'article');
if (($this->countmodules('right') == 1) || $articlemodule) : ?>
<div id="content1">
<jdoc:include type="component" />
</div>
<div id="right">
<jdoc:include type="modules" name="right" style="xhtml" />
<?php if( $articlemodule): ?>
<jdoc:include type="modules" name="articlemodule" style="xhtml" />
<?php endif; ?>
</div>
<?php else : ?>
<div id="content2"><jdoc:include type="component" /></div>
<?php endif; ?>
Comments
Post a Comment