Skip to content

Instantly share code, notes, and snippets.

@christophengelmayer
Created January 5, 2017 13:12
Show Gist options
  • Save christophengelmayer/bfd9c3ba5e36111a9687a9626bb39dfa to your computer and use it in GitHub Desktop.
Save christophengelmayer/bfd9c3ba5e36111a9687a9626bb39dfa to your computer and use it in GitHub Desktop.
ProcessWire Language Switch
<ul class="navigation__language">
<?php
foreach($languages as $language) {
if(!$page->viewable($language)) continue;
$class = "$language" == "$user->language" ? "navigation__current" : "";
$url = $page->localUrl($language);
echo "<li class='$class'><a title='$language->title' href='$url'>$language->title</a></li>";
}
?>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment