I was thinking it would be nice if the navigation can be swapped out in exactly the same way as sections and templates could.
There are many reasons i want to do this:
1. I want to be be able to change the layout of the navigation quickly so i can try out new designs quickly.
2. I want to be able to put multiple navigation styles and structures on separate pages based on templates.
2a. This would be for example a single level navigation control across the top, and then on other pages a full left side tree navigation. Each Module would be configurable to allow the administrator to control the number of levels it displays, etc.
SO the reason i am posting is i am curious why this has not happened before because the navigation is really just another module to me.
Was there some specific architectural reason why this is a bad idea perhaps that i have not encountered yet?
i am also curious if this is worth it as it wil mean changing the core page engine in many ways and dont want to do this unless its likly to get back into the main trunk.
Hi Ged
In this situation I generally just write a web user control because it takes less time to write, probably has better performance, and doesn't require any administration.
You could write a module with various parameters and get it to load different web user controls depending upon configuration, so the menu rendering could be completely different. You could also use a standalone section to reduce administration overhead. This would require no change to any page engine code.
Many thanks
Simon
Hey,
thanks fro feedback.. Needed some to see what others think.
i really think this would be useful to me anyway. I like the idea of being able to have the level 1 nav across the top the level 2 to x down the side.
Also, some designs break up the site where not all the nav is show , except when you go back to the home page.
Being able to change this quickly will make rapid prototyping much quicker.
This actually has got me think about what types of thing you average nav module would need as params:
1. Start Level (int)
2. End Level (int)
3. Expand selected node one level down (bool)
i guess everything else can just be in the actual code for presentation layer of the mod itself.
Maybe some base navigation modules would be good, where the basic node graph building is done, with virtual classes in the bse, being able to be overridden the concrete class.
i am getting carried away again maybe :)
Hi Ged,
Have you worked on any navigation modules yet?
Just interested to see how your doing and if its working as you expected, I would also like to have the nav as a module to allow the navigation to be split up.
Steve
I'm also interested in such a module. So keep us updated on the progress!
Hey ,
Have not gotten it working yet as other stuff pressing.
Its not its own module but requires a fair bit of changes to the core.
G
I have developed such a component.
My component outputs UL/LI combination so I could use lot of css stylesheets I already have for menus, sitemaps, ecc.
The basic structure is a repeater bind to:
this.rptNav2.DataSource = this._page.ActiveNode.ChildNodes;
or
this.rptNav2.DataSource = this._page.ActiveNode.NodePath[0].ChildNodes; // Bind level 1 nodes
or
this.rptNav2.DataSource = this._page.ActiveNode.NodePath[1].ChildNodes; // Bind level 2 nodes
Hope this helps...
Marco
Hi Marco,
Would you be willing to share your component either on here or in the contrib?
It would be really useful to see how you acheieved this.
Many thanks
Steve
My navigation control is so simple..
Two repeaters controls, one (rptChilds) nested in the other.
The first is bound to this._page.RootNode.NodePath[0].ChildNodes; (or another level)
on the ItemDataBound each repeater row is a Node, so I can:
Node node = (Node) e.Item.DataItem;
and bound to childs nodes (if you want to show childs of each menu):
// Bind child nodes
Repeater rptChilds = (Repeater)e.Item.FindControl("rptChilds");
if (rptChilds != null)
{
rptChilds.ItemDataBound += new RepeaterItemEventHandler(rptChilds_ItemDataBound);
rptChilds.DataSource = node.ChildNodes;
rptChilds.DataBind();
}
Hope this helps,
Marco