Created
January 5, 2017 13:12
-
-
Save christophengelmayer/bfd9c3ba5e36111a9687a9626bb39dfa to your computer and use it in GitHub Desktop.
ProcessWire Language Switch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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