DvdW
Posts: 10
|
Posted: 04/25/2012, 12:53 AM |
|
Hi,
I make a bridge with another post wich concerned Default Menu item.
After an answer post, I've try to modify the custom template variable for the class of the item (see below). It doesn't work with the default custom template variable (MainMenu:Submenu) but it works fine if I add a new custom template variable (MainMenu:MSubmenu).
So, why it works with a new variable and not with the existing one ?
HTML
--------
<!-- BEGIN Item -->
<!-- BEGIN OpenLevel --><ul><!-- END OpenLevel -->
<li><a href="{ItemLink_Src}" class="{MainMenu:Submenu}{MainMenu:MSubmenu}" target="{MainMenu:Target}" title="{MainMenu:Title}">{ItemLink}</a>
<!-- BEGIN CloseItem --></li><!-- END CloseItem -->
<!-- BEGIN CloseLevel --></ul></li><!-- END CloseLevel -->
<!-- END Item -->
Doesn't work
------------------
global $FileName, $Tpl;
if ($FileName == "destinations_list.php") {
if ($Header->MainMenu->ItemLink->GetValue() == "Destinations") $Tpl->SetVar("MainMenu:Submenu", "active");
else $Tpl->SetVar("MainMenu:Submenu", "");
}
OK
----
global $FileName, $Tpl;
if ($FileName == "destinations_list.php") {
if ($Header->MainMenu->ItemLink->GetValue() == "Destinations") $Tpl->SetVar("MainMenu:MSubmenu", "active");
else $Tpl->SetVar("MainMenu:MSubmenu", "");
}
if ($FileName == "quartiers.php") {
if ($Header->MainMenu->ItemLink->GetValue() == "Destinations") $Tpl->SetVar("MainMenu:MSubmenu", "active");
else $Tpl->SetVar("MainMenu:MSubmenu", "");
}
|
|
|
|