> For the complete documentation index, see [llms.txt](https://staylime.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://staylime.com/docs/volume-themes/faq/navigation-and-header/smart-category-menu-does-not-highlight-my-category.md).

# 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.

{% stepper %}
{% step %}

### 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.
{% endstep %}

{% step %}

### 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.
{% endstep %}

{% step %}

### Fill it with the menu link's handle

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.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
Products fall back to their **tags** when `custom.top_level_category` is empty, and the same rule applies — the tag has to be the handle form of the menu link. A tag reading `New Arrivals` does not match the link `new-arrivals`.
{% endhint %}

{% hint style="warning" %}
The highlight only appears on the plain collection or product URL. Filtered, sorted and paginated URLs, and search results, are not part of the match.

If **Breadcrumbs** is enabled in theme settings, product pages are matched against the collection-scoped URL (`/collections/…/products/…`) instead, so the highlight follows the collection the visitor came through.
{% endhint %}

{% hint style="success" icon="lightbulb" %}
The same **Menu** group holds **Highlight menu items** — a text field where you list menu item names separated by commas. That one is a styling accent on specific links and has nothing to do with Smart Category Menu; the two are easy to mix up.

Full setup in [Smart Category Menu](/docs/volume-themes/navigation/smart-category-menu.md).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://staylime.com/docs/volume-themes/faq/navigation-and-header/smart-category-menu-does-not-highlight-my-category.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
