hello to all
I need to see, in the pages of my website, even if I am in an inside page, the main menu item of the page
in attached image page is called design and build, daughter of our services, but I would see at the top our services or the parent menu
how can I do?
display only the voice of the top-level menu
Re: display only the voice of the top-level menu
Do you mean you need to be able to style the active parent menu item in top menu (for this example you want to make the 'our services' menu item red)?
I think you should look for the class 'activeparent' but it depends on implementation in Menu Manager template that is used.
If not implemented look at the help of Menu Manager:
I think you should look for the class 'activeparent' but it depends on implementation in Menu Manager template that is used.
If not implemented look at the help of Menu Manager:
$node->parent -- True if this node is a parent of the currently selected page
Re: display only the voice of the top-level menu
thanks
my menu templete is this:
{if $count > 0}
<ul id="menu-main-menu" class="navigation--main">
{* <ul class="nav navbar-nav navigation--main"> *}
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string='<ul class="sub-menu">' times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}{repeat string='</li></ul>' times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}
{$classes=''}
{if $node->parent == true or $node->current == true}
{$classes='current-menu-item'}
{if $node->parent== true}{$classes=$classes|cat:' parent'}{/if}
{/if}
{if $node->type == 'sectionheader'}
{if $node->haschildren == true}
<li class="dropdown {$classes}"><a class="dropdown-toggle {$classes}" data-toggle="dropdown"><span>{$node->menutext}</span></a>
{else}
<li class="nav-header">{$node->menutext}</li>
{/if}
{elseif $node->type == 'separator'}
<li style="divider">
{elseif $node->haschildren == true}
<li class="dropdown {$classes}"><a class="dropdown-toggle {$classes}" data-toggle="dropdown" {if $node->target}target="{$node->target}" {/if}
href="{$node->url}"><span>{$node->menutext}</span></a>
{else}
<li class="{$classes}"><a class="{$classes}" {if $node->target}target="{$node->target}" {/if}
href="{$node->url}"><span>{$node->menutext}</span></a>
{/if}
{/foreach}
{repeat string='</li></ul>' times=$node->depth-1}
</li>
</ul>
{/if}
my menu templete is this:
{if $count > 0}
<ul id="menu-main-menu" class="navigation--main">
{* <ul class="nav navbar-nav navigation--main"> *}
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string='<ul class="sub-menu">' times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}{repeat string='</li></ul>' times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}
{$classes=''}
{if $node->parent == true or $node->current == true}
{$classes='current-menu-item'}
{if $node->parent== true}{$classes=$classes|cat:' parent'}{/if}
{/if}
{if $node->type == 'sectionheader'}
{if $node->haschildren == true}
<li class="dropdown {$classes}"><a class="dropdown-toggle {$classes}" data-toggle="dropdown"><span>{$node->menutext}</span></a>
{else}
<li class="nav-header">{$node->menutext}</li>
{/if}
{elseif $node->type == 'separator'}
<li style="divider">
{elseif $node->haschildren == true}
<li class="dropdown {$classes}"><a class="dropdown-toggle {$classes}" data-toggle="dropdown" {if $node->target}target="{$node->target}" {/if}
href="{$node->url}"><span>{$node->menutext}</span></a>
{else}
<li class="{$classes}"><a class="{$classes}" {if $node->target}target="{$node->target}" {/if}
href="{$node->url}"><span>{$node->menutext}</span></a>
{/if}
{/foreach}
{repeat string='</li></ul>' times=$node->depth-1}
</li>
</ul>
{/if}
Re: display only the voice of the top-level menu
sorry but I do not understand what should I do
Re: display only the voice of the top-level menu
Look at the page source to see what classes are available on the links you want to style, they can be combined...
a.menuactive.menuparent.parent {some style}
<li class="menuactive menuparent parent"><a class="menuactive menuparent parent" href="****gianlucacompagno.com/servizi"><span>Servizi</span></a>
a.menuactive.menuparent.parent {some style}
<li class="menuactive menuparent parent"><a class="menuactive menuparent parent" href="****gianlucacompagno.com/servizi"><span>Servizi</span></a>