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.

 

show module according browser language

show module according browser language

Hello,
I need to show a module only to italian people, so if language is italian.
If i change the language on internet explorer for test, the modole is shown even if from the debug i see $language = en (and not it).
My config is:
$language handling: browsers preferred languages
Preferred list of languages: it
Strict language comparison: no
Quick module position or id include: 148

With these settings the module 148 is always visible.
There's somthing wrong on my configs?

Thank you
Marco

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

Re: show module according browser language

Hi, I sent you an email with the following info (repeated here for anyone else who wants to do the same) :

Here's how to show the module to only people with their browser setting in Italian:

1 - ensure you read and understand the Quick Start guide: http://www.metamodpro.com/metamod/quick-start

2 - set $language handling to "Browsers preferred language" as you have done

3 - set Preferred list of languages to "it,en" if these are the 2 main languages you are detecting (although this step is not generally required). Note that this is not the same as restricting the module to only "it" language. It has a special use - see the popup help/description on the caption of the box. Basically, if any of the preferred languages of the browser are found in this box, then MetaMod will use one of them, even if it's not the browser's most preferred language. If that sounds too confusing then just leave it blank - don't just leave it as "it" as that will set the $language_code to "it" even if English is the browser's most preferred language but Italian is 2nd.

4 - leave the "Quick module position or id include" box EMPTY

5 - in the PHP box, use the following:

if ($language_code == 'it') return 148;

6 - save and test.

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:
11584
Newest User:
allen6221
Members Online:
0
Guests Online:
164

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