Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Template switch

Template switch

Hi,

I would like to know how can i change the template of my site with the language selection button.
(I'm using joomfish, joomla Version 1.5.15)

Example : when french is selected : Template 1 ; when English is selected : Template 2

Thanks in advance,

philgood
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

Re: Template switch

Hi Phil,

I assume you're using the (free) MetaTemplate.

(1) create a new rule
(2) at the top of the rule, set "$language handling" to "Joomla front-end language" (the default)
(3) don't touch the "preferred list of languages". That's for language negotiation with the browser.
(4) in the Advanced section, in the PHP box, write a rule like:

if ($language_code == 'fr') return true;

(5) then in the SUCCEED Actions, set the template that you want to use for French, using the drop-down provided
(6) repeat, setting up a new rule for each language that you want to detect.

Alternative:
- you can do this all in 1 rule if you want to.
- set up (1) to (3) as above
- for the PHP rule, write:

if ($language_code == 'fr') return 'beez';
if ($language_code == 'de') return 'ja-purity';
if ($language_code == 'nl') return 'template3';
if ($language_code == 'en') return 'template4';

I hope this helps,
Regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
4
User Info:
 
Total Users:
4378
Newest User:
miller2341
Members Online:
0
Guests Online:
138

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked