[SOLVED] Section Menu is-active class for non-section menu items

I am indeed a Lazy Blogger, so I’ve enabled the Section Menu for Lazy Bloggers. I also have the is-active CSS class working fine for the blog and the status sections.

Trouble is, the is-active class isn’t applied to the home or about pages, despite the fact I’ve added menu: "main" to the front matter :disappointed:

Thought I’d check first to see if I’m doing something obviously wrong before diving in to the deep and chilly menu waters :slightly_smiling_face:

Think you need something like this:

{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}is-active{{ end }}
1 Like

Thank you @royce, that works perfectly :slightly_smiling_face:. I really need to wrap my head around basic golang templating!