Blog Sections Open

Keeping Active States Correct in Wayfinder Menus with Dropdowns

How to make Wayfinder keep the right active class on both top-level and nested dropdown items.

Complex dropdown menus are where active-state logic tends to break down. A top-level item may not stay highlighted when a child page is open, or submenu links may lose the expected .active behavior because the markup is split across several templates.

The original Wayfinder setup used separate templates for top-level links, parent rows, inner wrappers, and submenu rows. That flexibility is powerful, but it means the active-state classes must be preserved carefully across every layer.

The durable lesson is that menu state is not only about the link you click. In nested navigation, the current child page should usually mark the full branch as active so the visitor can see which section they are inside.

Wayfinder can still handle this well, but only if the template structure respects the class placeholders all the way down the menu tree.

Newer post

Extending SimpleGallery with Upload, Save, Delete, and Refresh Hooks

How to use SimpleGallery events to generate thumbnails, clean up files, and enrich gallery metadata automatically.

Older post

Building a Large Multi-Level Menu with Wayfinder and DocLister

How to combine Wayfinder and DocLister for large multi-level menus, and when DLBuildMenu is the cleaner replacement.