display only the voice of the top-level menu

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

display only the voice of the top-level menu

Post by giapippo »

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?
Attachments
example
example
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: display only the voice of the top-level menu

Post by velden »

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:
$node->parent -- True if this node is a parent of the currently selected page
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: display only the voice of the top-level menu

Post by giapippo »

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}
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: display only the voice of the top-level menu

Post by giapippo »

sorry but I do not understand what should I do
:-[
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12709
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: display only the voice of the top-level menu

Post by Dr.CSS »

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>
Post Reply

Return to “Layout and Design (CSS & HTML)”