For the complete documentation index, see llms.txt. This page is also available as Markdown.

Smart Category Menu does not highlight my category

How Volume's Smart Category Menu decides which parent menu item to highlight, and why it needs a metafield to work.

Smart Category Menu keeps the top-level menu item of the section a visitor is browsing marked as active — so a customer deep inside a product page still sees which part of the store they are in.

It needs two things: the checkbox enabled, and a metafield telling the theme which top-level item each page belongs to.

1

Turn on Smart Category Menu

In Customize, open the Header section. Under the Menu heading, pick your top-level menu in Menu, then tick Smart Category Menu.

The checkbox stays hidden until a menu is selected in Menu — if you cannot find it, that field is still empty.

The Menu drawer section has its own Smart Category Menu checkbox in the same place. Mobile does not inherit the header setting, so tick it there too.

2

Create the metafield

Go to Settings → Metafields and metaobjects → Collections and add a definition with the namespace and key custom.top_level_category, type Single line text. Repeat for Products if you want product pages to highlight too.

3

This is the step that usually goes wrong. The value must be the handle of the top-level menu link, not its visible title.

A menu item shown as New Arrivals has the handle new-arrivals — so the metafield has to read new-arrivals, with a hyphen where the space is. Capitalisation is ignored, New-Arrivals matches just as well, but New Arrivals never will.

lightbulb

Last updated

Was this helpful?