[SOLVED] Hiding a specific submenu from top navigation

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
Bo Mellberg
Forum Members
Forum Members
Posts: 10
Joined: Fri Oct 16, 2009 12:24 pm

[SOLVED] Hiding a specific submenu from top navigation

Post by Bo Mellberg »

Hello!

My top menu looks like this:

MenuItem1 - MenuItem2 - MenuItem 3 - Internal

I want to show submenus on all top MenuItems, BUT "Internal". If you're not logged in, you shouldn't see what headings there are on the internal pages.

What would I modify to make this happen?

Best regards,

/Bo
Last edited by Bo Mellberg on Mon Nov 16, 2009 9:41 am, edited 1 time in total.
Peciura

Re: Hiding a specific submenu from top navigation

Post by Peciura »

Imageing forum will give you more results. Here is just one
forum.cmsmadesimple.org/index.php/topic,38533.0.html

Also search forum for pages with page extra value set to "restricted" or group that is allowed to access that page. Key words: "extra1", "extra2", "extra3", "MenuManager"
Bo Mellberg
Forum Members
Forum Members
Posts: 10
Joined: Fri Oct 16, 2009 12:24 pm

Re: Hiding a specific submenu from top navigation

Post by Bo Mellberg »

Thank you Peciura!

I really did search, but found only discussions about completely hiding pages from the menu. In my case I want to hide the meny from not logged in people, but when logged in, it should be visible both in top nav and side nav.

Thank you for the pointers. I tried the following:

Code: Select all

        <h2 class="accessibility">Navigation</h2>
        {menu template='plåstretmeny' number_of_levels='2' excludeprefix='interna_' }
{if $ccuser->memberof('Föräldrar')}
        {menu template='plåstretmeny' number_of_levels='2'  includeprefix='interna_' }
{else}
        {menu template='plåstretmeny' number_of_levels='1'  includeprefix='interna_' }
{/if}
        <hr class="accessibility" />
But the second meny (which is just one meny item, with or without submenu) gets located beneath the first, not to the right. Also, even if logged in, the submenu is not shown.
Bo Mellberg
Forum Members
Forum Members
Posts: 10
Joined: Fri Oct 16, 2009 12:24 pm

Re: Hiding a specific submenu from top navigation

Post by Bo Mellberg »

Update: I managed to make my submenu appear by using start_page instead of includeprefix, doh!

The problem is still that there are two menu bars instead of one.

Best regards,

/Bo
Bo Mellberg
Forum Members
Forum Members
Posts: 10
Joined: Fri Oct 16, 2009 12:24 pm

Re: Hiding a specific submenu from top navigation

Post by Bo Mellberg »

Solved.

I made them unshow under "options" and used show_all = 1 when logged in.

Thanks for all help!

/Bo
Peciura

Re: Hiding a specific submenu from top navigation

Post by Peciura »

Yes you did it.

But in general you need to go deeper - to edit menu template.
Open "Layout » Menu Manager" import template you want to start with. There is also very good "Module Help".
Use all this stuff to inspect template variables:

Code: Select all

{get_template_vars}, {dump item=$entry}, {$entry|debug_display}


That example includes apeariance depending on:  
1. "Extra Page Attribute 1:" of page and group that logged in visitor belongs to (or not)
2. page prefix (this one is not useful for you)

And if you like examples
search forum for pages with page extra value set to "restricted" or group that is allowed to access that page. Key words: "extra1", "extra2", "extra3", +"MenuManager"
Post Reply

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