Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Change language link


Go to End


1558 Views

Avatar
david

Community Member, 1 Post

6 June 2008 at 2:28am

Edited: 06/06/2008 2:34am

Hi,

I'm pretty new to SilverStripe and – unfortunately – I don't know much about php . Still I'd like to include a small link on every page, that allows the user to display the current site in another language. I know that it's pretty similar to the Language Chooser widget, but I'd prefer not to use a widget, also because I want to display images (flags) as links right next to the menu items.
-
Any help how I can do this?
Thanks in advance.
-
p.s. I tried something like this:

$url = $_SERVER['SERVER_NAME']; 
$page = $_SERVER['php_SELF']; 
echo "<a href='http://".$url.$page."&lang=XY' ><img src='http://URL'></a><a href='http://".$url.$page."&lang=XY'><img src='http://IMG'></a>"

but well, where do you place it? and is this even correct?