Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » show module according browser language
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
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.
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » show module according browser language
Board Info
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked