Menu Template Help

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
consystic
New Member
New Member
Posts: 6
Joined: Mon Mar 26, 2007 5:37 pm

Menu Template Help

Post by consystic »

Hello,

I am trying to create a menu template that will look like this (the blue boxes are section headers):

Image

Basically I just need the structure that will allow me to add borders on top and below each menu item. I don't think I can use unordered lists because the borders will not span the full width of the menu since lists are nested.

Has anyone been successful in doing this? I have tried replacing the lists with but I cant seem to get it to work and not have missing or extra html tags.

Here is the menu template I am using now in case it is needed:

Code: Select all

{if $count > 0}
    <div id="menu">
        <ul class="root">
            {foreach from=$nodelist item=node}
                {if $node->depth != $node->prevdepth}
                    {if $node->depth > $node->prevdepth}
                        <ul>
                    {elseif  $node->depth < $node->prevdepth}
                        </li></ul>
                    {/if}
                {elseif $node->index > 0}
                	</li>
                {/if}
            
                {if $node->current == true}
                    <li class="current">
                {elseif $node->parent == true or ($node->current == true and $node->haschildren == true)}
                    <li class="parent">
                {elseif $node->haschildren == true}
                	<li class="parent">
                {elseif $node->type == 'sectionheader'}
                	<li class="sectionheader depth{$node->depth}">
                {elseif $node->type == 'separator'}
                	<li>
                {else}
                	<li>
                {/if}
            
                {if $node->type == 'sectionheader'}
                    <div>{$node->menutext}</div>
                {else}
                    <a href="{if $node->id == 15}/{else}{$node->url}{/if}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}</a>
                {/if}
            {/foreach}
        
        {repeat string="</li></ul>" times=$node->depth-1}</li>
        </ul>
    </div>
{/if}
Thanks for your time!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Menu Template Help

Post by Dr.CSS »

And what does this spit out, page rendered then view source...
consystic
New Member
New Member
Posts: 6
Joined: Mon Mar 26, 2007 5:37 pm

Re: Menu Template Help

Post by consystic »

The current menu looks like this:

Image

The html:

Code: Select all

<div id="menu">
<ul class="root">
	<li class="sectionheader depth1">
		<div>General Information</div>
	</li>

	<li class="current">
		<a href="http://southernhighroads.dpdev.net/georgia">Georgia</a>
		
		<ul>
			<li>
				<a href="http://southernhighroads.dpdev.net/georgia/templates-and-stylesheets">Templates and stylesheets</a>
			</li>

			<li class="parent">
				<a href="http://southernhighroads.dpdev.net/georgia/pages-and-navigation">Pages and navigation</a>
				
				<ul>
					<li>
						<a href="http://southernhighroads.dpdev.net/georgia/pages-and-navigation/content_types">Content</a>
					</li>
				</ul>

			<li>
				<a href="http://southernhighroads.dpdev.net/georgia/menu-manager">Menu Manager</a>
			</li>

			<li>
				<a href="http://southernhighroads.dpdev.net/georgia/extensions-2">Extensions</a>
			</li>

			<li>
				<a href="http://southernhighroads.dpdev.net/georgia/events-manager">Events Manager</a>
			</li>

			<li>
				<a href="http://southernhighroads.dpdev.net/georgia/workflow">Workflow</a>
			</li>
			
			<li>
				<a href="http://southernhighroads.dpdev.net/georgia/where-do-i-get-help">Where do I get help?</a>
			</li>
		</ul>

	<li class="parent">
		<a href="http://southernhighroads.dpdev.net/contact">Contact Us</a>
	</li>

	<li class="parent">
		<a href="http://southernhighroads.dpdev.net/newsletter">Newsletter</a>
	</li>

	<li class="sectionheader depth1">
		<div>Section</div>
	</li>

	<li>
		<a href="http://southernhighroads.dpdev.net/page">Page</a>
	</li>
</ul>
</div>
It appears I need to not use lists and use a around each item with padding so that borders can be added that span the full width of the menu. I just can't seem to get it to work.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Menu Template Help

Post by Dr.CSS »

Have you tried...

#menu li {border-bottom: 1px solid #FFF}

all the li in your menu will have a white border on the bottom, including your section headers...

If you took the out of section headers you can still style them with...

li .sectionheader{your styling here}
consystic
New Member
New Member
Posts: 6
Joined: Mon Mar 26, 2007 5:37 pm

Re: Menu Template Help

Post by consystic »

Using #menu li {border-bottom: 1px solid #FFF} will put a white border on the bottom of each item but the border will not span the full width of the menu since some of the lsits are nested with padding. That is my main problem.  :(
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Menu Template Help

Post by Dr.CSS »

You could change the padding to the li a instead of the li, try Firefox with the Web Dev. toolbar for on the fly CSS editing...
Post Reply

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