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.


Popup MetaMod to choose location?

Popup MetaMod to choose location?

I'm working on a site that has different sections based on specific locations; Denver, San Francisco, Florida, Idaho. I was needing a way so that a visitor will see a choice between these four locations when they first visit the website and once chosen they will be redirected to that section; such as:

And this saves their selection to a cookie so that when that person visits the site again from that same computer this selection is skipped and they are returned to their previous chosen section.

One thought I had was that when the 1st time visitor enters the home page a popup shows four buttons, one for each state, asking the visitor to choose their default location.

Is this something achievable with MetaMod?


Beginner Modder
13 Posts
Administrator has disabled public posting

Re: Popup MetaMod to choose location?

Hi hominid4,

Although either MetaMod or Chameleon could be used for a purpose like this, neither of them will provide you with a popup mechanism for making the actual selection. I'd suggest that you search around on the JED for some way to make a modal window to display a page or the contents of a module. Once you have that then you can think about how MetaMod/Chameleon can help you to display this and manage the cookies.

You also need to think very carefully about the logic behind what you're doing. Here are some questions I think you'll need to think about:

1 - On which pages do you want the popup to appear for non-cookied browsers? All pages, or just front page, or a particular selection?

2 - What do you do for browsers that can't do cookies, where the cookies are either disabled, or in the case of crawlers (like Googlebot) where they can't store a cookie at all? Will you prevent them from viewing the pages?

If you find a module that allows you to display its content as a popup when a link is clicked on, then you could do something like the following:

1 - create a MetaMod, assigned only to the front page
2 - in it, check for the cookie. If the cookie exists, redirect to the appropriate page immediately
3 - if the cookie did not exist, then display the "popup module". The popup module will send people direct to 1 of the 4 different city pages.
4 - create another MetaMod and assign it to the 4 city pages
5 - inside this MetaMod, detect which of the pages you are on, and set the cookie to "that one".

In this way, as soon as you visit 1 of the 4 city pages, the cookie will be set. If you visit the front page, the cookie is detected and you get sent back to whichever of the 4 pages you visited last.
If there was no cookie, then you get to see the front page, but you also see the popup and have to choose one of the choices.

Coming to think of it, you could avoid the popup box thing by simply putting the 4 links onto the front page, making the front page look like the popup you were suggesting. You'd still have a MetaMod on the front page to check for the existence of a cookie, and a MetaMod on the other 4 pages to set a cookie once the user lands there.

Hope that helps a bit...

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

Re: Popup MetaMod to choose location?

Hi Stephen, thanks for the great answer!  You've gave me better ideas that I'll try out.  If it's easier I could make a separate landing page (instead of a popup) that show the city selections that new visitors are redirected to for them to choose from?

There will be links at the top to each section and even if the visitor has chosen a location they'll still need to be able to click on the other locations and/or go back to the home page.

I've printed out your reply and am reading back through it now.

Thank you again!,

Edit additional info:

Regarding questions 1 and 2, we were thinking of just having the cookie on the home page, and if by chance cookies are disabled (or such) then just nothing happens would be fine.  It's not a critical situation where the visitor has to choose the location, the client is just attempting to make it more convenient for the visitor of those areas. Thanks!

Edited By: hominid4
19-Sep-11 03:16:39

Beginner Modder
13 Posts
Administrator has disabled public posting

Board Info

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

There are no members online

Forum Legend:

 New Sticky