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.

 

One different picture in an article depending on the country

One different picture in an article depending on the country

Hello,

I am using joomla 1.5.26 and last free version of metamod.

my question is simple bt i don't know if it is easy to achieve.

Here is an example of what i wish i could do :

let's say there are 2 pictures picture A and picture B.
Let's say if people are in UK they can see picture A in an article but they can't see the B.
If people are outside of UK they see picture B instead of the A in the same article.
I am just wondering if it is possible?

Thanks  in advance and thanks again for this amazing extension.

EDIT: Seems like it's working with {loadposition x} inside an article which is a great thing. I managed to make visible or exclude a photo for only one country. But how to do both at the same time? I mean in 1 recipe photo A visible and photo B excluded, is it possible?

Finally i come back several jours later with some feedback, i just wanna say my bad because actually its working but not with non existing position of my template. loadposition doesn't work with it but works perfectly with any positions of my template which is not that bad but not so good because i really wanted to load those photos in the middle of an article.

Edited By: meyloo
24-May-12 16:34:38

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

Re: One different picture in an article depending on the country

Hi Meyloo,

I don't know why this would fail to work with module positions that are not in your template - that's strange.

Disregarding that for a moment, here's how I would approach this:

1 - set up your two image modules with the appropriate images. Set them to a module position that IS in your template, but keep them unpublished.

2 - download the GeoIP library from MaxMind, unzip it and put it into a folder in the root of your web folder called "geoip"

3 - set up a MetaMod in a module position that ISN'T in your template, e.g. "countryswitcher". Keep it PUBLISHED.

4 - in the MetaMod, turn on the GeoIP support for GeoLiteCountry

5 - in the MetaMod, use the following PHP code:

if ($fromCountryId == "GB") return XXX;
else return YYY;
// replace XXX with the module id to use for the UK image,
// and YYY with the module id to use for everyone else.

6 - in your article, use {loadposition switcher}


That should work!

Best 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: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: One different picture in an article depending on the country

Thank you metamodguy!!! because of your step above I successfully make mine!!!!

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

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5914
Total Posts Today:
1
User Info:
 
Total Users:
10816
Newest User:
sakmy567q
Members Online:
0
Guests Online:
93

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