Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.



Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.


GeoIP working on all pages but home page

GeoIP working on all pages but home page


We are trying to set up Metamod Pro to show a different module in a sidebar depending on location. Basically we want to show one module for the UK, and another module for anywhere outside the UK. I have the following code in the PHP box:

if ( $fromCountryId == "GB" ) return 165;
return 337;

Everything seems to be working as it should on all pages apart from the homepage, where it always displays module 337 no matter what. I have disabled all caching in order to rule it out as a cause but to no avail.

This is the first time I've used Metamod so I could be overlooking something pretty elementary, but I can't think what it could be. Any thoughts?



Beginner Modder
1 Posts
Administrator has disabled public posting

Re: GeoIP working on all pages but home page

Hi Greg,

That's certainly a puzzling one. If it wasn't working on the inner pages then I'd say it's a simple setup issue, but now I'm not so sure.

Usually the reason for "it always thinks I am in GB" is that the server and client are on the subnet without a public IP address, and in this case GeoIP defaults to saying you are in GB. But I don't think that's your issue.

Could you point me to your site so I can see the issue in action? I'm in NZ so would expect to see the non-GB version.

The usual things to check on your side would be:

1 - ensure that the "target modules" (ie. the ones that MetaMod includes) are set up to not display on any pages, either by setting them to display on "pages: none" or setting them to a non-existent module position

2 - the MetaMod should be published and set to display on ALL pages OR on selected pages (not "none" or nothing will be displayed)

3 - don't have the caching in global preferences or the system cache plugin enabled

4 - in the MetaMod, if you are using code in the PHP box, then leave the "quick module id or position include" box empty.

If you're still struggling with it I'm happy to log in to your site as admin and take a look – just PM me the site address and superadmin details. (create a new superadmin account – don't send me your regular login details please)

Best regards,

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

3330 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
Total Topics:
Total Polls:
Total Posts:
Total Posts Today:
User Info:
Total Users:
Newest User:
Members Online:
Guests Online:

Forum Legend:

 New Sticky