2013-08-20, 08:09:01
I have another question:
The whole day I try to get the i18n menu to generate the correct classes for the isCurrent and isCurrentPath variables without success.
I initially tried a simple menu without custom rendering, but I didn't get the classes I need to make the current page/path stand out in the menu.
Now I tried with custom rendering, but the variables never become true, although I'm on the page.
Component "mainmenu":
<?php
echo '<li class="'.$item->classes;
if ($item->isCurrent) {echo ' current';}
if ($item->isCurrentPath) {echo ' path';}
....
?>
Everything else seems to work fine, but the only class I ever get is the page slug...
I call the menu like this:
<?php get_i18n_navigation('index', 0, 0, I18N_OUTPUT_MENU | I18N_FILTER_MENU, 'mainmenu') ?>
It's basically a static menu with just the toplevel pages.
I read through the docs ten times now but somehow I don't get any classes although it seems this should be trivial.
Thanks for any hint!
Cheers,
Tom
The whole day I try to get the i18n menu to generate the correct classes for the isCurrent and isCurrentPath variables without success.
I initially tried a simple menu without custom rendering, but I didn't get the classes I need to make the current page/path stand out in the menu.
Now I tried with custom rendering, but the variables never become true, although I'm on the page.
Component "mainmenu":
<?php
echo '<li class="'.$item->classes;
if ($item->isCurrent) {echo ' current';}
if ($item->isCurrentPath) {echo ' path';}
....
?>
Everything else seems to work fine, but the only class I ever get is the page slug...
I call the menu like this:
<?php get_i18n_navigation('index', 0, 0, I18N_OUTPUT_MENU | I18N_FILTER_MENU, 'mainmenu') ?>
It's basically a static menu with just the toplevel pages.
I read through the docs ten times now but somehow I don't get any classes although it seems this should be trivial.
Thanks for any hint!
Cheers,
Tom