Switching between 1 and 3 column layout - the easy way! - Joomla! Forum - community, help and support


when using fixed width design, run problem of not having enough space load forum or gallery. typical work around design 2 templates. 1 use site (2 or 3 columns) , 1 use forum / gallery or other component requires more space. method works, more of hassle worth, requires twice work , not effective method highlighting below.

using switch statement, can conditionally load template 1, 2 or 3 columns. way works, when template loaded, checks see whether components have set being called. if so, load first part of template outlined below. if not, use second bit - set default.

code: select all

<table>
 <tr>
  <td><?php mospathway(); ?>
</td>
 </tr>
 
<!-- if forum or gallery, load 1 column -->
<?php switch ($option) {
 case 'com_smf':
 case 'com_gallery':
?>
<tr>
 <td><?php mosmainbody(); ?></td>
</tr>
 
<!-- else load 2 column layout -->
<?php
  break;
default:
?>
<tr>
 <td><?php mosmainbody(); ?></td>
 <td><?php mosloadmodules ( 'right' ); ?></td>
</tr>
 
<?php ;
 break;
}   ?>
 
</table>


เอามาจาเว็บนอกอะนะ :pop

น่าจะมีตัวอย่างให้ดูด้วยนา..แบบไม่เก่งอังกิด :)





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