views:

39

answers:

1

Hi there,

I want to create a dynamic menu that will get it's items from a certain node type. I thought I could do this by creating a view of the titles and putting it in a block. However, when someone clicks on one of these titles I want to highlight it, and so want a way of adding an active class to the link. I know Drupal does this automatically for menus, but can I do it for a menu based on a view?

Thanks in advance.

A: 

I'm not real sure about your requirements for a "dynamic menu" but an alternative to the view-of-titles might be to set up a custom menu, then when you create these nodes, set them to be part of that menu in the node edit form. Then display that menu in the block And you should get the highlighting of active items you want.

Andrew
Hi Andrew, thank you for taking the time to respond to my question. I needed the menu to generate links automatically if people created a new page, so I couldn't use a standard menu. I have solved the problem by using a view of titles. These actually automatically include an active class, which I didn't realise they did.
Ben

related questions