Jump to:

23377 Posts in 18296 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » Multilingualcontent pretty URLs? Such as "mysite/en/page"

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

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

Page: 1
Go to End
Author Topic: 702 Views
  • KungK
    Avatar
    Community Member
    14 Posts

    Multilingualcontent pretty URLs? Such as "mysite/en/page" Link to this post

    Hi,

    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 http://doc.silverstripe.org/multilingualcontent stuff.

    First off and most important. Can I get prettier URLs? I would love to have http://www.mysite.com/en/about-us for English and http://www.mysite.com/sv/about-us 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:

    <ul>
    <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>
    </ul>

    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!

  • dompie
    Avatar
    Community Member
    88 Posts

    Re: Multilingualcontent pretty URLs? Such as "mysite/en/page" Link to this post

    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.

  • KungK
    Avatar
    Community Member
    14 Posts

    Re: Multilingualcontent pretty URLs? Such as "mysite/en/page" Link to this post

    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!

    702 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.