Any way to break long lists in nav menu?
beardedgit
Registered Users Posts: 854 Major grins
Hi folks.
I've got my nav menu set up to show links to folders, subfolders and galleries as per the following screenshot:
I'd like to be able to break the long lists into two columns (or more if required) when they return more than, say, 20 entries. Can it be done? I've not found any such option in the menu setup.
I've searched Dgrin for various combinations of "break", "menu", "nav" and "list" but only find break-hacks for Legacy.
If anyone could point me in the right direction I'd be much obliged :thumb
If it helps, my ongoing tinkerings can be found at http://beardedgit.smugmug.com/
I've got my nav menu set up to show links to folders, subfolders and galleries as per the following screenshot:
I'd like to be able to break the long lists into two columns (or more if required) when they return more than, say, 20 entries. Can it be done? I've not found any such option in the menu setup.
I've searched Dgrin for various combinations of "break", "menu", "nav" and "list" but only find break-hacks for Legacy.
If anyone could point me in the right direction I'd be much obliged :thumb
If it helps, my ongoing tinkerings can be found at http://beardedgit.smugmug.com/
Yippee ki-yay, footer-muckers!
0
Comments
It's a shame that we're not allowed to throw a bit of custom javascript at it :cry
I would recommend against having such a deeply nested menu, because using a multi-level pop-out menu is a usability nightmare. It requires mouse pointing precision at a similar level as playing a game of "operation" to avoid menus accidentally collapsing or being eclipsed by an option you didn't mean to select.
It also makes it impossible to open multiple galleries from the same menu at the same time (because middle-clicking on a link causes the menu to close and you have to start over).
Please check out my gallery of customisations for the New SmugMug, more to come!
Nice trick. Thanks for sharing. May I ask something? I've put this code in the theme CSS section, but it's not working for me. Is that the correct place?
Please check out my gallery of customisations for the New SmugMug, more to come!
- It only works on the hard-coded item, so for any other sub-menus that grow to an unwieldy length I'd have to go in and change the CSS rule;
- It changes the original list order (not sure if that's a bad thing though);
- It wouldn't cope if the next item I add (latest, therefore at the top) returns text longer than the 20em width, so another change to the rule would be necessary:
- The break-point can't be defined - it spreads the list over 2 columns by default, it doesn't overflow to a second column only when a set number of entries in the original column is exceeded.
I'll keep it and tinker with it, it's a good starting point for casual enhancement. Thanks againYes, of course I've edited that, but it's not working. I'll still research more. Thanks.
Sent from my Galaxy Note 8
I noticed that in your CSS you've got several C++ style comments (lines beginning with //). This is not actually valid CSS (the only comments allowed are enclosed by /* */) and is breaking this customisation on your site!
Please check out my gallery of customisations for the New SmugMug, more to come!
From my perspective, I would have thought it would make for a better user experience if you DID add another level to your menu. Scanning down long lists seems, to me, less efficient than going to a another level.
However, you of course know your site and site users infinitely better than me.
I would just urge you to maybe reconsider as see if it WOULD work for you.
www.acecootephotography.com
There are pros and cons either way. More levels allows for shorter lists but each extra level pushes the lowest level further to the right which can lead to an "exit offstage right" condition. Fewer levels keeps the lowest level on the pitch horizontally but makes the upper levels longer which can lead to the lowermost links going below the fold.
It's a question of screen real-estate, and the number of items that lay claim to it will only grow as more albums are created.
I'm coming to the conclusion that a better solution might be to have the lowest levels open in their own scroll-boxes instead of forcing columns. That's what I've been playing with lately but so far there's nothing that I'm happy to put live. Scroll-boxes aren't my strong suit.
www.acecootephotography.com
I suppose it depends on the length of the text in the menu.
By way of a demo I deployed Lamah's excellent code, adapted for a column width of 30em to accommodate the long titles in my Wildcamping folder, to show how it goes East in extreme cases. As you can see, there was nowhere else for the thing to go except sideways:
Anyway, it's no longer an issue for me, I've gone for scroll-boxes instead. Currently I have them in only two specified places but they reduce screen-clutter fairly well without being too intrusive, IMHO:
All I need now is a way to target each right-most menu level, instead of targeting specific folders by href$=
I like the look of your solution - I think its neat and I would image easy to use.
Good luck going forward :andy
www.acecootephotography.com
Cheers!
FWIW, here's the CSS that I'm using currently in "Entire Site", I expect it'll change if I find a better way of targeting:
Is there a way to apply this code for ALL drops in the nav that go longer than 260px or do I HAVE TO specify the category?
The goal is to set it and forget it, having it lying in wait for drops that grow too large.
overflow-y: scroll; changed to overflow-y: auto;
What's the change do for you that the original did not?
Hopefully someone smart with this stuff like Lamah will chime in.
Only works on 2nd level flyout drops huh?
Thank you for your advice, I'll check it out.
Code as follows:
OK, so it's not pretty code and there's probably a better way of doing it, but it'll be fine for my lowly needs.