Query in navigation menu

I’d like to use a query to manage my mega navigation menu so that my customer can modify it easily.
It works on static pages, but not on dynamic pages such as archive pages.