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.

 

Recipe for URL redirect depending on language

Recipe for URL redirect depending on language

The main language of the site is English, latest version of MetaMod, Joomla 1.5 and latest version of Joomfish. One of the menu items redirects to an external link and is obviously the the menu type "external link". So what I am trying to do is when either the browser language is another language other than English, or if the user select another language (using Joomfish on the front-end), for example French, is to have the external link redirect to another URL. I have tried to use existing recipes with a bit of modification but can't seem to get it working. Any help would be appreciated!

Thanks.

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

Re: Recipe for URL redirect depending on language

Hi Wrogo,

unfortunately there's no standard way to change the exact contents of a menu item from inside MetaMod, at the point of display.

However JoomFish allows you to "translate" external links and provide an alternative. That would at least cover the case where JoomFish is displaying the rest of the page in French; the link would follow suit. So you can use a different link for each language.

If you want to show that alternative link based on the browser language irrespective of what JoomFish is doing, then you have to do some work-arounds. i.e. you could provide a different menu module that includes the different link in it. If you are currently using a standard mod_mainmenu module, then you can replace that with a module on this site called ElastiMenu. Elastimenu allows you to selectively hide menu items in a menu. So you would create your menu with both links in it as separate menu items, then use 2 ElastiMenu modules, one which hides one of them, and the other hides the other one. Then use MetaMod to switch between the two.

But I think that JoomFish is the best approach.

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

Re: Recipe for URL redirect depending on language

Hi Stephen,

Many thanks for taking the time to write such a detailed reply - much appreciated! I must admit I have not looked at Joomfish close enough and so did not realise I could do a URL redirect with it. I have now done so and it has proven to be a neat solution, many thanks for pointing this out to me!

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

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Total Posts Today:
2
User Info:
 
Total Users:
4371
Newest User:
kajha63871
Members Online:
0
Guests Online:
176

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