Skip to content

Instantly share code, notes, and snippets.

@spadino
Forked from stchr/languageswitch.php
Last active August 29, 2015 14:26
Show Gist options
  • Save spadino/aff517edde153e5cc7a0 to your computer and use it in GitHub Desktop.
Save spadino/aff517edde153e5cc7a0 to your computer and use it in GitHub Desktop.
Language Switch for Kirby
<?php foreach (c::get('lang.available') as $lang): ?>
<a<?php if($lang == c::get('lang.current')) echo ' class="active"' ?> href="<?php echo url($page->uid(), $lang) ?>">
<img src="<?php echo url('assets/images/flags/' . $lang . '.png') ?>" alt="" /><?php echo $lang ?>
</a>
<?php endforeach ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment