Switching Languages

One of the most important elements on a multi-language site project is a language toggle, so your visitors can easily change their language.


  span class="st0">'lang.available'
 
    " " 
 
   
 

You can use this simple list and change the HTML to fit your project or you could build your own from scratch. Kirby automatically sets a new config variable: lang.current, which contains the shortcode for the currently active language. Together with your config setup for available languages it is pretty straight forward to build whatever you are looking for.

To switch URLs, you can either use…

$page->url($lang)

…which will change the URL for the current page.

Or you can switch to a different homepage, by using…

$site->url($lang)