Community

How do i not render a menu item on that item's page?

I have a custom menu with 9 pages in it. I have that menu displaying only on each of those 9 pages. I'd like to not render a menu item when the user is on that item's page.

So if I have a page called My Drupal in the menu along with 8 other items, I don't want My Drupal to show in the menu when on the My Drupal page. But I do want it to show on the other pages, while not showing that page's menu item.

When I say render, I mean not have it rendered in the html at all. I'm sure I can hide it with CSS but I'd prefer to simply not have it in the code to begin with.

Any suggestions?

Comments

Anyone?

Anyone?

---

That's not exactly "best practice" to remove menu items like that. It would be better to add an "active" css class to the item and have it display differently instead (change the background/font colors, etc).

nobody click here