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.

 

MetaMod per country doesn't work

MetaMod per country doesn't work

Hello,

I want to display a menu title for Brazilian users only.

To do that, I created a specific menu and module and installed MetaMod.

I've installed Geoip data file, as instructed and tried a million different combinations, but can't seem to get it running.

If I publish the menu module, it is always displayed. If I unpublish it, it's never displayed.

Since I'm not in Brazil, I've also used the IP override, that's seems to be ignored. Metamod is picking the module ID for the menu independently of where I am located and my IP address.

Since my request is rather simple (just show a different menu title for BR users), it shouldn't be that complicated.

So please help!

This is the PHP code I've used:
if ( $fromCountryId == "BR" ) return 131;

Thanks!

nunonogueira
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: MetaMod per country doesn't work

Hi nunonogueira,

(1) the MetaMod itself will always be displayed whether or not it contains another module (131 in your case), unless you use the Pro version. However, in many cases this is fine, if you turn off the title display of the MetaMod, and adjust the module css class suffix and/or "style for included modules".

(2) the simplest setup for your situation would be:

a - leave the PHP box blank
b - enter BR into the "only these countries" box
c - enter 131 into the "quick module id or position include" box.
d - in "Enable GeoIP/GeoCity", choose "GeoIP Country (free or commercial)"
e - ensure that module 131 is set to "module assignment: no pages".

Also try turning on debug mode in the MetaMod to ensure that it's finding the GeoIP database.

Cheers,
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
3312 Posts
User info in posts
Administrator has disabled public posting

Re: MetaMod per country doesn't work

Hello Stephen,

I've followed your indications, they seem logical to me.

When publishing MetaMod in menu position, even if I hide the module title, I always see the title (in this case MetaMod).

If I publish MetaMod on the right column of my template (sidebar-b), I get the following info:
MetaMod debug info:
Module ID: 130
$option: com_k2
$view: latest
$id:
$Itemid: 1800
$timezone: UTC
$language: pt-pt
$language_code: pt
$language_region: pt
Start date/time has been reached.
End date/time has not passed.
Country: NL
Country Name: Netherlands
Rejecting: NL is not in include list

This happens, wether or not I type my IP address in the IP override field.

What can be the problem? I just want to display a different Menu Item name for BR users and a default one for all other users.

Anyway, thanks for your support!

nunonogueira
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: MetaMod per country doesn't work

Hi nunonogueira,

Did you turn off the title of the MetaMod, or the title of the module you want to display? Normally if you turn off the title display of the MetaMod then you are just left with the display of the included module's title.

The Netherlands vs BR thing is strange. Can you please send me the IP address you are using as an override, and I'll see if that correctly resolves to BR? It's possible that the MaxMind database is simply getting it wrong (and we could contact MaxMind to alert them). Try 200.140.120.42 which MaxMind knows is in Brazil (Brasil Telecom).

Out of interest, how are you attempting to set up the menu item swap? Is it by displaying 1 menu module for people in Nrazil, and a different menu module for people elsewhere? If so, once you have the basic setup working you might want to change the way you set it up to this:

1 - don't use the "only these countries" box
2 - don't use the quick module id or position include" box
3 - in the PHP box, type:

if ( $fromCountryId == "BR" ) return 131;
else return XXX;

// replace XXX with the module id of the module to show for all other countries.


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
3312 Posts
User info in posts
Administrator has disabled public posting

Re: MetaMod per country doesn't work

Hi,

I turned off the menu title of MetaMod.

I'm using IP 81.71.14.182. It worked well with the IP you provided, but when the module isn't displayed, I get a white box.

In order to not overcomplicate, I was trying to add an extra menu item for BR users (keeping all others). Because the module is published in 'menu' position, it always show the title "MetaMod" wether it the title is on or off.

nunonogueira
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: MetaMod per country doesn't work

Hi,

putting your IP address into http://www.maxmind.com/en/geoip_demo shows it as being a wanadoo.nl IP address, and incorrectly labels it as being in the Netherlands. You're not using a VPN, are you? If that IP address is your actual IP address in Brazil than I suggest that you contact This e-mail address is being protected from spambots. You need JavaScript enabled to view it and let them know who of your IP address, ISP, and physical address.

On the other matters:

1 - yes, when MetaMod does not include another module, the basic HTML of the MetaMod module is still shown. Depending on the CSS of your template/page, this can set aside a white box. See more about this in the FAQ:
http://www.metamodpro.com/metamod/faq/2 … th-matamod
http://www.metamodpro.com/metamod/faq/2 … etamod-was

In that 1st link there are some things to try to fool the CSS of your page into not setting aside space, e.g. by working with the css class suffix of the MetaMod (and other methods). You could try these.

In general, the Pro version of MetaMod completely gets around these issues, because there's no MetaMod module "wrapping" the modules that the MetaMod displays.

2 - Title display. This is a bit of an awkward thing, and suggests that your template may not be displaying menus in quite the normal way. Of course you could just rename the MetaMod to the actual name that you want to be displayed for the menu, but then you'd still have the issue about the module not appearing for anyone other than in Brazil.


I think there's a good chance that MetaMod Pro will fix the problem for you, though there's a chance that your template is doing "clever" things with menu modules and that may not work. If you do want to try that I'm happy to give a full refund if it doesn't work on your template.

Actually there's another way we could approach it which would definitely work, using my other extension, Chameleon. With Chameleon what you would do is to set up the "Brazil" menu item(s) as part of your main menu, not as a separate menu. Then using the built-in GeoIP support you would detect if the visitor comes from Brazil. If not then you would disable the extra menu item, selecting from a list of all menu items. This then affects the menu items displayed by any menu module on the site. I think this may be a more elegant way to achieve the same result.

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
3312 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1667
Total Polls:
6
Total Posts:
5909
Posts this week:
1
User Info:
 
Total Users:
10118
Newest User:
jack67484
Members Online:
2
Guests Online:
175


Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked