Display Table if Mod position is used else... - Joomla! Forum - community, help and support


hello,

i not sure ask this, want display table 3 columns. however, want have active on template if want have module in 3 spots.

say have :

user 1 - user 2 - user 3

if no module using user 3, there table built user 1 , 2 filling it. can have user 3 column collapse... make sense? 

any ideas?

thanks!

try this:

code: select all


<?php if ( moscountmodules( 'user1' ) || moscountmodules( 'user2' ) || moscountmodules( 'user3' ) ) { ?>
<table class="mytable">
<tr>
<php if ( moscountmodules( 'user1' ) ) { ?> <td class="user1"><? mosloadmodules( 'user1' ) ?></td> <? } ?>
<php if ( moscountmodules( 'user2' ) ) { ?> <td class="user2"><? mosloadmodules( 'user2' ) ?></td> <? } ?>
<php if ( moscountmodules( 'user3' ) ) { ?> <td class="user3"><? mosloadmodules( 'user3' ) ?></td> <? } ?>
</tr>
</table>
<? } ?>


if there no modules assigned either user1, user2 or user 3, table not printed out.
otherwise, cells printed according whether or not there modules assigned corresponding position.

helpful?

cheers,

ndtreviv





Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code