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 switching problem

Template switching problem

I used this code and it worked

if ($language_code == "es") return "beez";
if ($language_code == "en") return "wideheaderblankbottonmarzo2011-2";

But I have two languages so far maybe more next year and four templates  english en-gb front page template and spanish es-es front page template and an english template for everthing else when joomla front end language is en-g and a spanish template for everything else when language is es-es I am using joomfish to select language on front page and community builder for registration joomla 1.5.22 and joomla built in sef urls if that matters? I want 4 templates like I said the code your recommended in the forums below that I modified doesn't work? I was going to use it and then continue on with another rule to specify the others.

if ($content_genius->check("pagetype = frontpage")) {
  if ($language_code == "es") return "beez";
  if ($language_code == "en") return "wideheaderblankbottonmarzo2011-2";
// add more as appropriate...
}

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

Re: Template switching problem

Although it's not completely clear what you're asking for, I'm going to make a guess and hope that I get it right!

The following PHP will return 1 of 4 templates depending on:
1 - front page, and english
2 - front page, and spanish
3 - all other pages, english
4 - all other pages, spanish

The PHP:

if ($content_genius->check("pagetype = frontpage")) {
  if ($language_code == "en") return "wideheaderblankbottonmarzo2011-2";
  if ($language_code == "es") return "beez";
}
if ($language_code == "en") return "rest-of-site-english-template";
if ($language_code == "es") return "rest-of-site-spanish-template";


Hope that's what you're after,
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
3314 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1685
Total Polls:
6
Total Posts:
5912
Total Posts Today:
4
User Info:
 
Total Users:
11504
Newest User:
toko solo
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