How to use a specific template when a certain component is loaded

A forum with Tips, tricks and small tutorials.

Moderators: mcsmom, unixboymd

Forum rules
Post Reply
User avatar
guilliam
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 159
Joined: Thu Aug 18, 2005 10:27 am
Location: Sunny City Cebu, Philippines!
Contact:

How to use a specific template when a certain component is loaded

Post by guilliam » Sun Aug 05, 2007 7:53 pm

this is a quick trick easy to do with newbies like me :)


CASE: my template is using 3 columns as a default and standard all thru our the site. HOWEVER i have a forum component like fireboard, joomlaboard, smf, etc.. that i want to use a template that is only one column or the forum component to use the entire width.

SOLUTION:

go and open the specific component you want to load a particular template like: components/the_component_name/the_component_name.php

insert this code somewhere after the "valid mos or die.."

Code: Select all

<?php
$cur_template = 'your_template_name';  
?>


or simply:

Code: Select all

$cur_template = 'your_template_name';


if its already enclosed within an opening and closing php tag.

calling in the template that is only one column or the template you want to load when that component is opened.

so if you want the standard solarflare to load up you can insert this on the component's code:

Code: Select all

$cur_template = 'rhuk_solarflare_ii';



- guilliam

keywords: template component, specific template component, use template on a component, particular, specific.
Last edited by mcsmom on Sat Oct 06, 2007 12:21 am, edited 1 time in total.
"I was one of those who wondered why people would pay so much $$$$ to do something that was so much fun!" -R. Harkrider, Fortran Code Engr.
^If u read that in $GREEN, you clearly missed the HIGHLIGHTS!
http://www.joomlancers.com | http://www.joomlaconsultancy.net

Post Reply