Menu Problems

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
aggregator

Menu Problems

Post by aggregator »

Hi guys. I'm having problems w/ my menu. Sometimes the buttons don't line up horizontally like they're supposed to. About half the time (especially if the connection is slow), the buttons will stack ontop of one another rather than side by side. Pressing F5 typically fixes this problem -- however, I would like it if my viewers didn't always have to do this when visiting the site. I had to link some of the menu buttons to a different domain of my website so I couldn't use the standard menus given.

I.E: http://example.sitename.com.

This is generally how my code for it looks:

Code: Select all

<ul id="primary-nav">
<li class="A"><a href="#"> </a>
  <ul>
    <li id="Aa"><a href="http://www.X.com"><img src="uploads/images/x.gif" /></a></li>
    <li id="Ab"><a href="http://www.X.com"><img src="uploads/images/x.gif" /></a>
      <ul>
	<li id="AbA"><a href="http://www.X.com"><img src="uploads/images/x.gif" /></a></li>
	<li id="AbB"><a href="http://www.X.com"><img src="uploads/images/x.gif" /></a></li>
      </ul>
    </li>
    <li id="Ac"><a href="http://www.X.com"><img src="uploads/images/x.gif" /></a></li>
    <li id="Ad"><a href="http://www.X.com"><img src="uploads/images/x.gif" /></a></li>
  </ul>
</li>
<li class="B"><a href="http://www.X.com"><img src="uploads/images/x.gif" /></a></li>
<li class="C"><a href="http://www.X.com"><img src="uploads/images/x.gif" /></a></li>
<li class="D"><a href="http://www.X.com"><img src="uploads/images/x.gif" /></a></li>
</ul>
Does anyone know why my menu buttons aren't lining up? Or if the menu used by default can add extra buttons that aren't actual pages of the site?
User avatar
lollipop27
Forum Members
Forum Members
Posts: 237
Joined: Wed Sep 12, 2007 4:09 pm

Re: Menu Problems

Post by lollipop27 »

aggregator wrote:
Or if the menu used by default can add extra buttons that aren't actual pages of the site?
You can make pages, that are not of the type 'content' but 'link'

so the menumanager will display them and the link can go to whatever
aggregator wrote:

I.E: http://example.sitename.com.
does this help?
aggregator

Re: Menu Problems

Post by aggregator »

Thx for the reply ;D. The option to select link is interesting. My example was to show me wanting to be able to create a link in my menu that wasn't an existing page in the cms. Another thing that kinda bothers me is that you can't create folders and stuff pages into that  :'(. Or at least I'm not aware you can. Making another domain is kind of my solution lol. Kind of sad, I know -- but I do what I gotta do.
User avatar
lollipop27
Forum Members
Forum Members
Posts: 237
Joined: Wed Sep 12, 2007 4:09 pm

Re: Menu Problems

Post by lollipop27 »

aggregator wrote: Another thing that kinda bothers me is that you can't create folders and stuff pages into that.
what do you mean by that??

you can achieve a page hierachy by choosing a parent page... and if you don't want the parent to be an own page, you make it a section header (which is sort of an "folder")
aggregator

Re: Menu Problems

Post by aggregator »

Both of the things you mentioned are good in their own way and I'm glad you told me about them. Although, what I'm trying to do is link to a different URL. The linking you mentioned keeps adding my URL first so it keeps looking like: http://www.mysite.com/https://abc.mysite.com/

Is there any way I can fix this?

Edit: Also, is there a way that I could insert a class or id to a specific button?
Last edited by aggregator on Thu Feb 21, 2008 9:19 pm, edited 1 time in total.
User avatar
lollipop27
Forum Members
Forum Members
Posts: 237
Joined: Wed Sep 12, 2007 4:09 pm

Re: Menu Problems

Post by lollipop27 »

you could add an id to your buttons (of the navigation i guess) by adding something like

id="{$page_alias}"

in your menuManager template....


then you can change each button via CSS
aggregator

Re: Menu Problems

Post by aggregator »

The css I can work easily, but how do I implement the code in the menu manager? I want to give the main menu buttons each a different background image. I'm pretty sure I could single out the main menu buttons, but how can I give every main menu item a different class so I can edit them independently?
User avatar
lollipop27
Forum Members
Forum Members
Posts: 237
Joined: Wed Sep 12, 2007 4:09 pm

Re: Menu Problems

Post by lollipop27 »

please post the MenuManger code you are using... i'll add it to your code then....


:)
aggregator

Re: Menu Problems

Post by aggregator »

You're awesome  ;D.

It's the standard one.

Code: Select all

{* menu template for 1024px theme for cmsms 1.04 by kermit 23 mar 2007 *}
{if $count > 0}<ul>
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul>" 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}
{if $node->current == true}
<li class="currentpage">{$node->menutext}
{elseif $node->parent == true}
<li class="activeparent"><a class="activeparent" href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}>{$node->menutext}</a>
{elseif $node->type == 'sectionheader'}
<li class="sectionheader">{$node->menutext}
{elseif $node->type == 'separator'}
<li class="separator" style="list-style-type: none;"> <hr />
{else}
<li><a href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}{if $node->target != ''} target="{$node->target}"{/if}>{$node->menutext}</a>{/if}{/foreach}{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>{/if}
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Menu Problems

Post by calguy1000 »

this is simple.... add class="{$node->alias}" inside each of the links in the menu manager template.

Then you just style each class that you want.

i.e:

Code: Select all

.home { background: url('home-page.png'); }
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
lollipop27
Forum Members
Forum Members
Posts: 237
Joined: Wed Sep 12, 2007 4:09 pm

Re: Menu Problems

Post by lollipop27 »

Code: Select all

{* menu template for 1024px theme for cmsms 1.04 by kermit 23 mar 2007 *}
{if $count > 0}<ul>
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul>" 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}
{if $node->current == true}
<li class="currentpage" class="{$node->alias}">{$node->menutext}
{elseif $node->parent == true}
<li class="activeparent" class="{$node->alias}"><a class="activeparent" href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}>{$node->menutext}</a>
{elseif $node->type == 'sectionheader'}
<li class="sectionheader" class="{$node->alias}">{$node->menutext}
{elseif $node->type == 'separator'}
<li class="separator" class="{$node->alias}" style="list-style-type: none;"> <hr />
{else}
<li class="{$node->alias}"><a href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}{if $node->target != ''} target="{$node->target}"{/if}>{$node->menutext}</a>{/if}{/foreach}{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>{/if}

i inserted it into the li... you can change that if you wnat... you can see how i did it...

you call it in the CSS just as calguy1000 said...
Last edited by lollipop27 on Fri Feb 22, 2008 3:37 pm, edited 1 time in total.
aggregator

Re: Menu Problems

Post by aggregator »

Hmm... I can't seem to get it to work. I added your code w/ the {$node->alias}. Then I went over to the css and added code similar to what calguy1000 wrote. I checked the page aliases and they're all correct. it's not working  :'(. The css is there -- the width of the buttons are changed but the images are not. 

my css code looks like this:

Code: Select all

.home { background-image: url(uploads/images/menu-item_01.png); width: 191px; }
Edit: It seems that the code I made by the same name isn't the one being used to create the menu. The one being used isn't being displayed by cmsms at all. I had to go into SSH to edit it.

I got width of the 3 buttons w/o dropdowns to change but the one w/ a dropdown did not. The code I edited looks like this:

Code: Select all

{* 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. *}
{if $count > 0}
<div id="menuwrapper">
<ul id="primary-nav">
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}

        {repeat string="<ul>" 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}
{if $node->parent == true or ($node->current == true and $node->haschildren == true)}
        <li class="menuactive menuparent" class="{$node->alias}"><a class="menuactive menuparent"
{elseif $node->current == true}
        <li class="menuactive" class="{$node->alias}"><a class="menuactive"
{elseif $node->haschildren == true}
        <li class="menuparent" class="{$node->alias}"><a class="menuparent"
{elseif $node->type == 'sectionheader'}
        <li class="sectionheader" class="{$node->alias}"><span> {$node->menutext} </span>
{elseif $node->type == 'separator'}
        <li class="{$node->alias}" style="list-style-type: none;"> <hr class="separator" />
{else}
        <li class="{$node->alias}"><a
{/if}
{if $node->type != 'sectionheader' and $node->type != 'separator'}
href="{$node->url}" {if $node->accesskey != ''}accesskey="{$node->accesskey}" {/if}{if $node->tabindex != ''}tabindex="{$node->tabindex}" {/if}{if $node->tit$
{elseif $node->type == 'sectionheader'}
><dfn>{$node->hierarchy}: </dfn>{$node->menutext}</a>
{/if}

{/foreach}

        {repeat string="</li></ul>" times=$node->depth-1}               </li>
        </ul>
<div class="clearb"></div>
</div>
{/if}
I'm pretty sure I'm missing the class="{$node->alias}" somewhere. Lastly, although the css worked and the widths can now be defined, the bg images still refuse to be there. When I use the old code that I got from lollipop27, the images would appear but the menu is in list fashion. Not a menu at all.
Last edited by aggregator on Mon Feb 25, 2008 2:25 pm, edited 1 time in total.
aggregator

Re: Menu Problems

Post by aggregator »

Sorry for double posting but it has been a while and there still hasn't been a response =[.
User avatar
lollipop27
Forum Members
Forum Members
Posts: 237
Joined: Wed Sep 12, 2007 4:09 pm

Re: Menu Problems

Post by lollipop27 »

are you sure your image-call is right?

have you tried to put it in some other div in the css, just to check?

Code: Select all

.home { background-image: url(uploads/images/menu-item_01.png); width: 191px; }


strange is this though
aggregator wrote: When I use the old code that I got from lollipop27, the images would appear but the menu is in list fashion. Not a menu at all.

The list styling is probabely because my code didn't have these id's:

Code: Select all

<div id="menuwrapper">
<ul id="primary-nav">

can you send a link?

or your complete menu css?
aggregator

Re: Menu Problems

Post by aggregator »

Looking at it from IE, the images show up! Just not for firefox... The Section Header I have as a menu main item isn't changing at all though. The ones that are just plain links work semi-perfectly. It's weird because the same CSS code I used works in FF only if the menu shows up as a list. The code I used looks like this:

Code: Select all

.home { background-image: url('/uploads/images/menu-item_01.png'); width: 192px; }
The code I gave you to edit wasn't linked to the menu at all. I left the file completely blank and it still worked. So I figured it was getting the code someplace else. I went into SSH and looked for the filename. Sure enough, I found it and it didn't show up in the menu manager. I edited it and saw real-time results. The code I linked last is the one that affects the website. I need to find a CSS code that works for both IE and FF.  :-\

Edit: Crap. It picks and chooses when it feels like working. I have the same code for the hover effect and it doesn't work in IE.

I tried both

Code: Select all

.home:hover { background: url(uploads/images/menu-item_01o.png); width: 192px; }
and

Code: Select all

.home a:hover { background: url(uploads/images/menu-item_01o.png); width: 192px; }
Last edited by aggregator on Mon Feb 25, 2008 4:06 pm, edited 1 time in total.
Locked

Return to “CMSMS Core”