Taming Your Backlight Mobile Menu

Currently we cannot assign one navigation menu to desktop displays and another to mobile devices.

If you have a lot of albums on your site,  they’re probably organized into nice and neat album sets that are reflected in the drop-down menu displayed on desktop sizes of your site. Because there are a lot of albums, this may pose a mobile menu usability problem.

Your desktop menu is designed so that visitors can use the drop-down menu to navigate to any album from your navigation menu by hovering over menu items and seeing the sub-items appear. And this looks great on a desktop display.

However, try looking at the mobile menu. Under the Galleries menu item you’ll see a long, long list of albums and sets. All your other links might get lost in this forest of links. And if you have any “side bar” content in the pallet, it gets shoved below the mobile navigation menu making for potentially a long scroll for your users (who may actually never see that content because it’s buried so deep).

Wouldn’t it be nice if you could remove all those sub-menu items from your mobile menu, just to neaten things up a bit? Sure, your viewers would have to tap on the Galleries link to go to your Galleries page and then on from there to individual albums, but it’s a small price to pay to get your mobile menu under control.

This is not too difficult to do with custom css.

What we can do is suppress all of the sub-menu items by adding this bit of code to your custom css file:

#page__pallet__T1 ul.sub-menu {
     display:none;
}

(NOTE: I’m using Pallet 1 for the vertical/mobile navigation. If you’re using Pallet 2, then substitute #page__pallet__T2 for #page__pallet__T1)

But let’s say you have some important sub-menu items under another main menu item and you want them displayed.

For example, on my main site I use a Non-interactive menu item (named Info) in my main menu that contains sub-menu items that need to be in the mobile menu.

In this case, I’ll use the nth-child( ) pseudo-selector and only suppress the sub-menu items below the Galleries link, leaving the sub-menu items under my Info link displayed in the mobile menu.

In my menu, Galleries is the third item. So I’ll use the nth-child(3) pseudo selector.

This is what I came up with:

#page__pallet__T1 li.menu-item:nth-child(3) > ul.sub-menu {
     display:none;
}

Just modify the nth-child number for your needs.
If you need to suppress more than one sub-menu, just add another selector with the appropriate nth-child number. For example, say you need to suppress the sub-menus in the third and forth menu items.

#page__pallet__T1 li.menu-item:nth-child(3) > ul.sub-menu, #page__pallet__T1 li.menu-item:nth-child(4) > ul.sub-menu {
     display:none;
}

This assumes you’re using horizontal navigation for the desktop version of your site.

If using vertical navigation, you’ll need to put the above in a media query so that it only takes effect when the browser size is of mobile width.

For example, you want your complete vertical navigation to show on desktop displays and tablets in landscape orientation. But you want the mobile menu to be displayed on tablets in portrait and anything smaller than a tablet.

@media only screen and (max-width: 768px) {
     #page__pallet__T1 li.menu-item:nth-child(3) > ul.sub-menu {
     display:none;
     }
}

You can adjust the media query width as needed for your purposes.

That’s it. Just a little bit of custom css and your Backlight mobile menu has been tamed!

1 thought on “Taming Your Backlight Mobile Menu”

  1. Hi Rod, this is VERY cool. In the current site the “expanded” menu on mobile devices always bothered me. Your CSS code fixes this. Thank you!

    (….my subdomain BL3 test website is a work in progress…)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About this site

This site is: a repository of time-savers and best practices from a user's perspective, picked up from several years of using TTG plugins.
This site is not: a support site.
Read more here.

Subscribe to new posts

Tip Jar

If this site has saved you some time, kept your hair attached, or otherwise prevented you from tossing the mouse through the monitor, feel free to donate.

Categories


Highly recommended. This is my go-to Lightroom book. Click on the book image. (affiliate link)

Affiliate link!

Current TTG versions

Backlight  4 & 5

See the Backlight Modules page on your site for latest Backlight and module versions and changelogs.

You’ll also find the latest version number and download link for the Lightroom Publisher plugin.
(BL 3 and later)

 

Backlight 1 Versions

Backlight 1.2.4
Pages module 1.2.4
Cart Add-on 4.1.7
Client Response Add-on 7.1.3
Theater Add-on 1.2.6
Galleria Add-on 1.0.0
WordPress Add-on 1.2.6
Publisher 3.2.3

Backlight 1 has seen its end of life. See this post.

CE4 Versions

note: CE4 is no longer being developed or sold. See this post.

TTG-BE: 2.0.5a
Autoindex: 7.0.8
Cart: 3.1.4a
CRG: 6.1.3a
Gallery: 6.1.10
Pages: 7.0.15
Publisher: 2.3.3
Stage: 6.1.6
Theme for WordPress: 3.1.2