Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# stuart.ladd 10/18/2006 9:04 AM
I wanted to be able to highlight the parent elements of submenus. Can't pattern match parents in CSS based on their children's profile. Current menu only supplies the "a.selected" class to the menunode you're currently looking at. I added the following lines into the HeierarchicalMenu.ascx.cs in the BuildListItemFromNode(Node) method below where it has the "//Dirty little trick to highlight the active item :)".
//Stu's dirty little trick to highlight the open items
			if (node.Level <= this._page.ActiveNode.Level 
				&& node.Id == this._page.ActiveNode.Trail[node.Level] 
				&& node.ChildNodes.Count > 0
				&& node !=this._page.RootNode)
			{	hpl.CssClass += " open";
			}

It just attaches the "open" class to anything with a submenu open which isn't the root node (since the root node is usually the home page. Can be ignored safely (since it just gives an extra CSS class).

Sorry, couldn't see where to submit source changes.

Stu

P.S. Cuyahoga so much easier than DNN!


# martijnb 10/18/2006 2:31 PM
Thanks for the tip!

With menu controls, I mostly advise to just create your own and embed these in your own template. So in your case, I'd copy the hierarchical menu and add your extension. This way you don't have to change the menu that comes with Cuyahoga.
P.S. Cuyahoga so much easier than DNN!

Thanks, but to be honest, I think that depends on what you're used to. If you're building ASP.NET applications the way Microsoft shows, DNN might be easier to understand.
Fact is that Cuyahoga is just much smaller :).
# stuart.ladd 10/24/2006 5:14 AM
By easier, I was mostly referring to skinning. DNN throws in a ton of nested spurious divs, spans and tables with IDs, classes and inline styles that make it a nightmare to apply your own CSS. But being smaller, it was very easy to customize that bit of code in Cuyahoga. I had to modify some code for DNN a while back and it was nightmarish.