Menu Manager shows some background image for hidden items

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
liomry
New Member
New Member
Posts: 3
Joined: Thu Mar 01, 2012 8:58 am

Menu Manager shows some background image for hidden items

Post by liomry »

Hi All,

I'm using an extra tag "restricted" to hide restricted pages with menu manager. I've modified the cssmenu_ulshadow.tpl as below (Using NCleanBlue). My modifications are in red.

It works as expected ( if you are not logged in to the correct group then restricted tagged pages are hidden ). However I do see a 9px high part of the background image for hidden menu items. Chrome identifies as

Code: Select all

<li class="separator once" style="list-style-type: none;">&nbsp;</li>
Removing this node in Chrome fixes the issue. How do I fix this in the Menu Manager template? ( I have very basic smarty knowledge only)

Menu template

{* CSS classes used in this template:
#menuwrapper - The id for the <div> that the menu is wrapped in. Sets the width, background etc. for the menu.
#primary-nav - The id for the <ul>
.menuparent - The class for each <li> that has children.
.menuactive - The class for each <li> that is active or is a parent (on any level) of a child that is active. *}

{assign var='number_of_levels' value=10000}
{if isset($menuparams.number_of_levels)}
{assign var='number_of_levels' value=$menuparams.number_of_levels}
{/if}

{if $count > 0}
<div id="menuwrapper">
<ul id="primary-nav">
{foreach from=$nodelist item=node}
{if ((($node->extra1 == 'restricted') and ($ccuser->memberof('members'))) or $node->extra1== '') }
{if $node->depth > $node->prevdepth}
{repeat string='<ul class="unli">' times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string='</li><li class="separator once" style="list-style-type: none;">&nbsp;</li></ul>' times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}
{if $node->parent == true or $node->current == true}
{assign var='classes' value='menuactive'}
{if $node->parent == true}
{assign var='classes' value='menuactive menuparent'}
{/if}
{if $node->children_exist == true and $node->depth < $number_of_levels}
{assign var='classes' value=$classes|cat:' parent'}
{/if}
{if $node->type == 'sectionheader'}
<li class="{$classes}"><a class="{$classes}"><span class="sectionheader">{$node->menutext}</span></a>
{else}
<li class="{$classes}"><a class="{$classes}"
{/if}
{elseif $node->type == 'sectionheader' and $node->haschildren == true}
<li><a ><span class="sectionheader">{$node->menutext}</span></a>
{elseif $node->type == 'sectionheader'}
<li><a ><span class="sectionheader">{$node->menutext}</span></a>
{elseif $node->type == 'separator'}
<li style="list-style-type: none;"> <hr class="menu_separator" />
{elseif $node->children_exist == true and $node->depth < $number_of_levels and $node->type != 'sectionheader' and $node->type != 'separator'}
<li class="menuparent"><a class="menuparent"
{else}
<li>
<a
{/if}
{if $node->type != 'sectionheader' and $node->type != 'separator'}
{if $node->target}target="{$node->target}" {/if}
href="{$node->url}"><span>{$node->menutext}</span></a>
{/if}
{/if}
{/foreach}
{repeat string='</li><li class="separator once" style="list-style-type: none;">&nbsp;</li></ul>' times=$node->depth-1}
</li>
</ul>
<div class="clearb"></div>
</div>
{/if}
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Menu Manager shows some background image for hidden item

Post by Dr.CSS »

That is for the bottom of the UL UL...

#primary-nav .separator,
#primary-nav .separatorh {
height: 9px;
width: 209px;
margin: 0px 0px -8px;
background: url(http://multiintech.com/defaultcontent/u ... /ulbtm.png) no-repeat left bottom;
}

Just below where you added the restricted stuff...

{elseif $node->depth < $node->prevdepth}
{repeat string='</li><li class="separator once" style="list-style-type: none;">&nbsp;</li></ul>' times=$node->prevdepth-$node->depth}

If you just don't want pages to show unless logged in maybe you can use Content Type: Protected in the content type drop down...
liomry
New Member
New Member
Posts: 3
Joined: Thu Mar 01, 2012 8:58 am

Re: Menu Manager shows some background image for hidden item

Post by liomry »

Thanks I had figured this was causing the issue, is there a way to work around it that you can see? Removing the line messes up the menu, as you would expect. I would have thought that since it was nested within my {if} it shouldn't be executing in this way?

Does the content type allow you to specify groups with access to the protected pages? The pages I'm trying to protect should only be accessible to certain accounts which are granted special access.

I'm doing a site for work which will contain admin-specific troubleshooting in addition to end-user troubleshooting tips and we don't want end-users to be able to view the admin related stuff. There are two groups - pending and members.

Once you register you are added to the pending group until I log in and manually add you to the members group at which point you can see these pages.
Post Reply

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