Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.


philgood
Beginner Modder
ranks
useravatar
User Info

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,


Administrator has disabled public posting
metamodguy
useravatar
User Info

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

Administrator has disabled public posting

Board Info

Board Stats:   Total Users: 3078  Total Topics: 1195  Total Polls: 7  Total Posts: 4448  Posts this week: 18
User Info:   Newest User :  fbanchini   Members Online: 1   Guests Online: 156
Online 
fgth
Topic
New
Locked
Topic
New
Locked
Sticky
Active
New/Active
Sticky
Active
New/Active
New/Closed
New Sticky
Closed/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky Active Locked
Active/Sticky
Sticky/Locked
Sticky/Active/Locked