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.

 

How to display a Module according website language

How to display a Module according website language

Hi,

I have a website in English and French and I would like to display a slide show according to the language selected. So if I'm in English I will display module A, if I'm in French I'll display module B.

I just installed MetaMod and tried to display a slide show module with following parameters "if ( $language_region == "en-gb" )return 113;" but with no success.

Does anyone knows how to do that?

Thank you very much for your help.

Edited By: freeman76
22-Sep-09 03:37:26

freeman76
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: How to display a Module according website language

Hi Freeman76,

in this case I would use $language_code instead of $language_region.

Here's how it works:

$language may be "en-gb"
$language_code would then be "en"
$language_region would be "gb".

Also, don't forget to set the "$language handling" setting correctly for your setup. Do you want $language (and $language_code and $language_region) to be set based on:

1 - the language set in the user's browser?
2 - the language set in the user's browser, but picked from a list of languages that you can handle (this is generally better than [1]) ?
3 - the front-end language of the site (which can be changed by the user if you're using JoomFish or similar) ?

OK, so the recipe:

Code:

if ($language_code == "en") return 113;

Hope that helps,
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
3319 Posts
User info in posts
Administrator has disabled public posting

Re: How to display a Module according website language

Hi Metamodguy,

It worked like a charm. You guys really rock, this module is very powerful and I'm wondering maybe buy-in the pro version to help you guys.

Once again, thank you very much for your help.

Helio

freeman76
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: How to display a Module according website language

Hi Helio,

donations or purchases of MetaMod Pro are always welcome! I look at it as a win-win...

Glad it's helpful,
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
3319 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1675
Total Polls:
6
Total Posts:
5917
Posts this week:
6
User Info:
 
Total Users:
11577
Newest User:
owens65784
Members Online:
0
Guests Online:
282

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