Free cms blog design page
Home Joomla Hacking Multiple layouts with one template
Multiple layouts with one template  E-mail
User Rating: / 0
PoorBest 

Multiple layouts with one template

Jump to: navigation, search

I found that it was a bit of a pain to code and keep track of multiple templates so ive been searching for a way to do this in Joomla 1.5. I stumbled upon this solution thru a few different threads.

Basically I'm testing for the existence of say Fireboard and delivering a unique layout for that & testing for MyBlog then delivering a different layout for MyBlog and if none of these exist then just churn out the standard content block.

You should be able to swap these values out for any component.

<?php if (JRequest::getVar('option') == 'com_fireboard' ) {?> <!--code to detect Fireboard is loaded-->
 
  <div class="MainCol">
    <jdoc:include type="component" />
  </div>
  <div class="RightCol">
    <jdoc:include type="modules" name="RightCol" style="none" />
  </div>
 
<?php  }  elseif  (JRequest::getVar('option') == 'com_myblog') {?> <!--code to detect Blog is loaded-->
 
  <div class="LeftCol">
     <jdoc:include type="modules" name="LeftCol" style="none" />
  </div>
  <div class="MainCol">
     <jdoc:include type="component" />
  </div>
 
<?php  }  else {?>
 
   <jdoc:include type="component" />
 
<?php   } ?>
BlinkList     Del.icio.us     Digg This!     Diigo Diigo    Facebook     Furl     Google     Ma.gnolia     Mr. Wong     Seed Newsvine     Reddit     Slashdot     Stumble It!     Technorati     Yahoo MyWeb
 

Add your comment

Your name:
Your website:
Subject:
Comment:
  The word for verification. Lowercase letters only with no spaces.
Word verification:
The $5 Script Archive
The best of PHP, MySQL, Flash and XML technologies, brought together at one low price.

 

 

Group 2 Tab

Group 4 Tab