Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I find that when I have mulitiple tiers or more than 3 items in the 2nd tier, my menus end up "squished" (super narrow). I've changed the setting in the CSS to set it as a fixed width (in a previous beta release -- haven't messed with it again since I updated to the latest beta), but that affects all of the submenus (haven't taken the time to separate each one in the CSS). I'd really like the "auto" size feature that it's set to in the CSS to work properly and I'm not sure why it's not (if I need to change a setting or if there's a limitation that I'm not aware of).
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#9 | Screen-shot-2012-01-17-at-4.54.jpg | 108.48 KB | atodd |
#8 | megamenu - screenshot.png | 209.63 KB | Pete Richards |
#6 | working.png | 53.98 KB | drwierdo |
#6 | Not working.png | 77.79 KB | drwierdo |
marinelli_bug2.png | 531.32 KB | pjbarry21 |
Comments
Comment #1
Lioz CreditAttribution: Lioz commentedHI pjbarry21,
the actual code of the megamenu is designed to work with a 3-level hierarchy with a maxiumum of four 2nd-level items.
we are working to make it more flexible.
Comment #2
trvs CreditAttribution: trvs commentedHaving the same issue. I only have 2nd level menu items as well.
Can you post a fix it?
Thanks!
Comment #3
pjbarry21 CreditAttribution: pjbarry21 commentedIn a previous beta I was able to manually adjust the width of the submenus (think it was in the "megamenuWrapper" css, but it's been a month or two and not sure that was where). Anyway, I can't seem to change that now. I know a "real" fix might be some ways away, but can you tell me how I can manually change the width of the submenus?
Thanks!
*****************************
Update -
I turned off aggregate CSS and cleared the cache for the site. I was able to make my changes in primary-links.css and then I cleared the cache again and turned the aggregate CSS feature back on. Still working.
I've only been able to adjust the width as a group (all submenus are the same width), but this is sufficient for now (some are a bit wide, but better than before). We only have 1 submenu level, so I don't know if this manual override would work/be efficient for more extensive menus. If/when the submenus start working (width adjusting "correctly") for unlimited levels, that would be great.
Thanks.
Comment #4
mcaden CreditAttribution: mcaden commentedThe class I changed to get this to work was .mega. I'm not sure which css file it's in because I'm using the sweaver to edit my themes.
However, I think the theme needs to not make a separate column for level 2 menu items without children.
Comment #5
mcaden CreditAttribution: mcaden commentedSorry, I think I misread the initial issue.
My problem is that I've got a bunch of l2 items with no l3 items. What's happening with me is that I'm getting a single column of my l2 items and the mega menu is stretching out like I've got 6 columns when all I really wanted was a single column of l2 items. I resolved this by created a DISABLED l2 item, and setting the links I wanted to be children of that.
EDIT: When I did this it exposed a bug in IE8 where the 3rd lvl UL element was being added directly to the parent UL without an LI. Chrome, Firefox, and IE7 (oddly enough) were smart enough to figure it out but ie8 flipped out and started displaying mega menu items at the page level, totally breaking the page. To fix this I added:
at line 186 of theme.inc such that it adds an unstyled LI tag if as the parent if the L2 menu is disabled.
Comment #6
drwierdo CreditAttribution: drwierdo commentedI have almost six sections under one main menu item, and each sections have 8 sub menu items, and the megamenu renders it alright (the basic science menu of 1st picture) but it renders the other one in a single column, no matter what (clinical science menu of 2nd picture). Even when i made the "megamenuwrapper overflow" fixed (changed "auto" to "400px"), the width doesn't increase. I can't make it work. Any suggestions??
Comment #7
drwierdo CreditAttribution: drwierdo commentedThis is how i made it work: Each primary item has a unique id assigned to it. So, if you want to attack a particular sub-container (or sub-menu, whatever) you have to style starting with that primary menu id.
In the screenshot that i have attached above, the "clinical science" primary link, has the id of "menu-main-title-778" (You can use firebug to inspect the menu id). The css for the primary navigation is in the primary-links.css. So, i made the following changes in the primary-links.css:
And now only the sub-container of clinical science is 750px wide!!
Comment #8
Pete Richards CreditAttribution: Pete Richards commentedHi there
I've fixed my mega menu using a CSS amend. Please note you'll need to tailor the CSS to your particular requirements - It's by no means a one size fits all. But it stopped me from pulling my hair out before a more robust fix is in place :)
I had the problem whereby adding any more than 3 primary links (with sub-links) caused my mega menu to be one long line of links one after the other. It was ugly and impossible to scroll all the way to the bottom. So I made the following CSS changes:
primary-links.CSS
.megamenuWrapper{
overflow:auto;
padding:15px;
width:600px; /* Set a width for the overall menu when expanded */
height:300px; /* Set a height for the overall menu when expanded */
}
.menu-section{
float:left;
height:150px; /* Set a height for each individual primary link container (this contains the primary link and it's related secondary links) */
width:200px; /* Set a width for each individual primary link container */
}
Playing about with the heights and widths above has (on my drupal install) fixed the mega menu as you'll see in the attached. Just makes sure that the .megamenuWrapper width and height are divisable by the .menu-section width and height you set (otherwise it might not fit).
Hope that helps
Pete
Comment #9
atodd CreditAttribution: atodd commentedHello,
I am new to Drupal and have installed and would like to use the Megamenu but it is not working correctly. I have searched and everyone seems to want the opposite that I need! I need the menu to create columns because I have several 2nd level items with several 3rd level items under them. Here is my structure in the Main Menu links manager:
Top Level
---Second Level Item
-----Third Level Item
-----Third Level Item
-----Third Level Item
---Second Level Item
-----Third Level Item
-----Third Level Item
-----Third Level Item
---Etc...
No matter what I do, the menu will not put the links into columns. It stays really narrow and puts links that have two words or more onto multiple lines (see picture). If anyone can help me I would be greatly appreciative.
Comment #10
djsagar CreditAttribution: djsagar at OpenSense Labs commentedHi tried editing the primary-links.css in the .mega section also with :
And all it did was allow six 2nd-level items. If I add any more than 6, the panel turns into a long skinny column and doesn't display properly. Any other suggestions please.