Ionize User Guide Version 0.9.6


Display the languages menu

Displaying the language menu is done through the <ion:languages /> tag and a dedicated helper.

This tag will display the websites languages name and link to the current content for the selected language.

The default language navigation helper is a PHP function stored in the /application/helpers/navigation_helper.php file : get_language_navigation()

This helper will output an unordered HTML list (UL and LI)

<-- Code in view -->
<ion:languages tag="ul" id="my_lang_nav" class="nav" active_class="active" />

<-- HTML Result on the Home page with 2 languages : "English" as default language and "Français" --> 
<ul id="my_lang_nav" class="nav">
    <li class="active"><a href="http://yourdomain.tld/home">English</a></li>
    <li><a href="http://yourdomain.tld/fr/home">Français</a></li>
</ul>

<-- HTML Result on the Services page (internal) with 2 languages : "English" as default language and "Français" --> 
<ul id="my_lang_nav" class="nav">
    <li class="active"><a href="http://yourdomain.tld/en/our_services">English</a></li>
    <li><a href="http://yourdomain.tld/fr/nos_services">Français</a></li>
</ul>

Use your own Helper

The default helper can be replaced by your one :

Take care to copy all the helpers functions into your own helper, even you modify just one of them. Ionize will use your theme helper is it exists and will not load the default one.

Why not directly modify the default helper ?

You can do that.

But in case of Ionize upgrade, you will have to take care to not overwrite your helper (and of course to think about).

Creating a theme helper will always keep the "core" of Ionize clearly separated from your theme.

Disable the Helper

<!-- Code -->
<ion:languages tag="ul" class="langs" id="my_langs" no_helper="true" >

  <li><a href="<ion:url />"><ion:name /></a></li>

</ion:languages>

If you disable the helper, you'll need to use the languages children tags. See : Language Tags