Connecting Tech Pros Worldwide Help | Site Map

Can I have a vertical sub-menu in a horizontal type CFMenu?

Haitashi's Avatar
Member
 
Join Date: Jun 2007
Location: Orlando, FL
Posts: 94
#1: May 29 '08
Hello everyone:

I have a CFMenu with the type set to horizontal. I'd like to have the sub-menu items open vertically. Is that possible?

Here is my code. I want the Portals sub-menu (Portal A, Portal B, Portal C) to open vertically instead of horizontally.
Expand|Select|Wrap|Line Numbers
  1.             <cfmenu name="topMenu" type="horizontal" fontsize="14" fontcolor="##7A7251"
  2.                font="'Lucida Sans', verdana, sans-serif;" selectedFontColor="##F58026" 
  3.                 menustyle="background-image:url('../images/toplinks_bg.gif');"    
  4.                 bgColor="##FFFFFF" childstyle="float:center;border-style:solid;padding:0px;border-width:0px;display:inline;margin-left:45px;">
  5.  
  6.                     <cfmenuitem name="home" href="##" 
  7.                     display="Home"/>
  8.  
  9.                 <!--- The ColdFusion menu item has a pop-up menu. --->
  10.                 <cfmenuitem name="portals"
  11.                         href="##" display="Portals" childstyle="border:0px;padding:2px 10px 2px 10px;">
  12.                     <cfmenuitem name="fso"
  13.                         href="##" display="Portal A"/>
  14.                     <cfmenuitem name="fso"
  15.                         href="##" display="Portal B"/>
  16.                     <cfmenuitem name="fso"
  17.                         href="##" display="Portal C"/>
  18.                 </cfmenuitem>
  19.  
  20.                 <cfmenuitem name="logout" href="##" 
  21.                     display="Logout"/>
  22.             </cfmenu>
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: May 29 '08

re: Can I have a vertical sub-menu in a horizontal type CFMenu?


Aren't all sub-menus vertical? See third item here.
Haitashi's Avatar
Member
 
Join Date: Jun 2007
Location: Orlando, FL
Posts: 94
#3: May 30 '08

re: Can I have a vertical sub-menu in a horizontal type CFMenu?


Acording to that link:
Quote:
Menus can have submenus, but only the top menu can be horizontal. All children of a horizontal menu are vertical.
However, no matter if I set the menu type to horizontal or vertical, all the child nodes of "Portals" still open horizontally. Is this just me? O.o

I'm suspect of styling... Maybe there's some CSS misfit code that's affecting how it's being displayed. I'm gonna look into that and report back.
Haitashi's Avatar
Member
 
Join Date: Jun 2007
Location: Orlando, FL
Posts: 94
#4: May 30 '08

re: Can I have a vertical sub-menu in a horizontal type CFMenu?


Yes, there are some styling issues. Apparently the site's styles are overriding the YUI CSS. I ran an instance of CFMenu on a blank page on the same server and it worked fine.

Very imp lesson learned. I will now hunt for the specific styles and make changes. I will also convey to our designer that he should use more specific styling. As far as I can tell, he applied styles to UL and LI. This looks like the cause of the problem.
Haitashi's Avatar
Member
 
Join Date: Jun 2007
Location: Orlando, FL
Posts: 94
#5: May 30 '08

re: Can I have a vertical sub-menu in a horizontal type CFMenu?


Found the culprit:

#toplinks li {
display: inline;
}

The div class where I placed the CFMenu was called toplinks. This display attributed caused the sub menu to open horizontally instead of the default vertical. Good to know that there's a way to do that since by default submenu will open vertically and there's no clear way to change it.

So, in case anyone ever needs vertical sub menus in CFMenu - There ya go! jeje
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#6: May 30 '08

re: Can I have a vertical sub-menu in a horizontal type CFMenu?


Thanks for posting the solution and, what do you know, you've actually discovered a way to display sub-menus horizontally should anyone need it.
Reply