This topic is locked
[SOLVED]

Dynamically change background and text color of a menu item

3/8/2024 8:25:40 AM
ASPRunner.NET General questions
D
david powell author

I am using the modify menu event to succesfully hide menu items, and change the text that is displayed.

I havent suceed though in changing the text colour, background colour, or text style through this event - fine doing it in menu builder, but I would like to dynamically grey out menu items if those choices arent available (for some other configuration reason) to the user.

Has anyone got any idea show to achieve this?

Many thanks

David

D
DRCR Dev 3/9/2024

You'd have to write the complex logic you require prior to displaying the menu and then filter visual elements to CSS from that result.

It's easier to not to mess with that, and instead leave the menus alone and modify the redirect pages managed by rules from the originating pages. These are also more likely to achieve the marketing prowess you're seeking instead of faded menues and "cannot click links"

D
david powell author 3/9/2024

Many thanks for replying and your advice.