Of course it is possible. In your
Then in your template, do eg.
For documentation on the
functions.php
file, simply wrap all of that code in a custom function & call it in your template. However, I don't know of any I18n parameter in that function to use custom markup (not a component), so you might need to use the return_i18n_menu_data
function, like this:PHP Code:
<?php
function build_i18n_nav($data, $loop = 0) {
$activeClass = 'active';
$subMenuClass = 'dropdown';
$output = '<ul' . ($loop !== 0 ? ' class="' . $subMenuClass . '"' : '') . '>';
for ($i = 0; $i < count($data); $i++) {
$item = $data[$i];
$output .= '<li' . ($item['current'] ? ' class="' . $activeClass . '"' : '' ) . '><a href="' . htmlspecialchars(find_i18n_url($item['url'], $item['parent'])) . '">' . $item['menu'] . '</a>';
if ($item['haschildren'])
$output .= build_i18n_nav($item['children'], ++$loop);
$output .= '</li>';
}
$output .= '</ul>';
return $output;
}
function output_i18n_nav($url, $minlevel, $maxlevel, $showtype) {
$menu_data = return_i18n_menu_data($url, $minlevel, $maxlevel, $showtype);
echo build_i18n_nav($menu_data);
}
?>
Then in your template, do eg.
PHP Code:
<div id="site-nav"><?php output_i18n_nav(return_page_slug(), 0, 2, I18N_SHOW_MENU) ?></div>
For documentation on the
return_i18n_menu_data
function, refer to the website docs or this documentation page I built to provide extra-detailed info.