2016-04-11, 19:38:47
(2016-04-09, 00:18:49)lokothodida Wrote: You can add classes to the elements in the menu with components.
To show the left side menu, you can do something like this:
PHP Code:<?php
$slug = return_page_slug(); // current page slug
$parent = returnPageField($slug, 'parent'); // find the parent
$parent = $parent ? $parent : $slug; // if there is no parent, use current page
// Main Menu
get_i18n_navigation($slug, 0, 99, I18N_SHOW_MENU);
// Left Menu
get_i18n_navigation($parent, 1, 99, I18N_SHOW_NORMAL);
?>
More stuff about i18n navigation can be found on mvlcek's site.
Thank you very much for your help, but I can't get this to work for me, probably because I am a PHP beginner. I came up with this solution, maybe it can be improved, but it works :-)
PHP Code:
$home = get_site_url(false);
$slug = (string) return_page_slug();
$parent = (string) get_parent(false);
if (!$parent) {
echo '<li><a href="'.$home.$slug.'" class="current">'.$slug.'</a></li>';
} else {
echo '<li><a href="'.$home.$parent.'/">'.$parent.'</a></li>';
}
get_i18n_navigation(return_page_slug(), 1, 100);