MenuItem state is always 'null'

For my menu I use normally

menu = Neos.Neos:Menu

But I missed the classes normal, current or active. So I looked at the array from Neos.Neos:MenuItems in the debug console. And the state of every page is ‘null’.

I’m using Neos 9.

You have to set calculateItemStates to true in the menu.

It is disabled by default as the calculation is quite expensive for larger menus and you need to cache the menu for each page.

We usually recommend to cache the menu globally and highlight the menu item in a client side script.

1 Like

I already looked at the documentation, but I overlooked this option.

And I’ve also seen how it’s handled in the Neos.Demo. But there, the parent menu items aren’t not marked as active.

Thank you again for your reply.