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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Multilingualcontent pretty URLs? Such as "mysite/en/page"

Go to End

3 Posts   1084 Views


Community Member, 14 Posts

22 December 2010 at 9:37pm

Edited: 22/12/2010 9:38pm


I've just started SilverStripe. Done all the starting tutorials and love it! Now I'm doing my first site (just for learning though) and I want it in atleast 2 languages. So I did the stuff.

First off and most important. Can I get prettier URLs? I would love to have for English and for Swedish.

Secondly, I need 3 hardcoded links in my theme that's separate from the main menu. What I did to get the link in the correct language is:

    <li><a href="{$BaseHref}?locale=$ContentLocale"><img alt="$Title" src="themes/silversalon/images/icon-home.gif" /></a></li>
    <li><a href="{$BaseHref}contact-us?locale=$ContentLocale"><img alt="$Title" src="themes/silversalon/images/icon-mail.gif" /></a</li>
    <li><a href="{$BaseHref}site-map?locale=$ContentLocale"><img alt="$Title" src="themes/silversalon/images/icon-map.gif" /></a></li>

Is there a better way? (Didn't get the PageByLang($url, $lang) function to work)

Edit: Forgot to say, thanks for a great CMS! Really enjoy the structure and the freedom to develop against it!


Community Member, 88 Posts

23 December 2010 at 12:07am

Changing URLs *inside* SilverStripe is hard work and would require core changes. Another, more comfortable way is to use apache2 urlrewriting (if this is an option for you). I don't know about other ways to to achieve this.


Community Member, 14 Posts

23 December 2010 at 12:48am

I do use Apache, so it's absolutely an option.
I'm fairly noob with Apache though, but I will look into it.

Thanks for your input!