I have a custom Menu Link that I would only like to appear on specific pages. These pages have a parameter being passed through via entity upcasting. It also has a custom access check.

I have tried having a check in the IsEnabled but if there are two pages consecutively that shouldn't have it enabled, it won't appear on pages that it should. I have also attempted to use the updateLink function, but to no prevail.

I am relatively new to Drupal so my apologies if more information is needed. If requested, I will try to upload more information.

Comments

wombatbuddy’s picture

destash’s picture

Wow, you always good wombat,,

alex_adaptive’s picture

Thanks, I will look at that module.

However, instead of using a module, I was looking at how I would do it programmatically so any further help would be appreciated.

wombatbuddy’s picture

Share your code to we can understand the problem.

alex_adaptive’s picture

I have decided to use that module instead. No point in reinventing the wheel when that can do what I need.

Thank you for helping!

destash’s picture

I dont know what module for handle your question (i need know too!! :p). But if you need solved fast you can create 1 menu different and place your menu block in header and setting visibility option what you want,,

Ex:

menu 1 -> home, gallery, about (not display in: article*)

Menu 2 -> home, article, gallery, about (display in: article*)