Page 1 of 1

multiple layouts with one template

Posted: Wed Mar 19, 2008 10:24 am
by webstar
I'm not sure if this has been posted before but here goes.
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 im 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

Code: Select all

<?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   } ?>
Anyway I hope this helps someone
Thanks
Derek