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
3313 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10734
Newest User:
gudad2
Members Online:
3
Guests Online:
183


Forum Legend:

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