cloudscribe/cloudscribe.Web.Navigation

Areas

Closed this issue · 3 comments

So I'm using some of this in an app right now. We use a lot of areas so I extended the models a big and add some code to the NavigationViewModel.cs file
if (node.Value.Area.Length > 0) { urlToUse = urlHelper.Action(node.Value.Action, node.Value.Controller, new { area = node.Value.Area }); } else { urlToUse = urlHelper.Action(node.Value.Action, node.Value.Controller); }

I saw a code comment about preserving parameters are still in the works. My advice is to think about Areas also.. or if I'm forgetting something else you have implemented for that, cool. I just put the Area in my navigation.json file and used that code.

yeah I have not thought about areas yet, I expect to do a bit of work on navigation in the coming weeks, I will definitely make sure it supports areas.

You'll need to add area, or whatever you use, into the findByUrl extension methods so currentNode is set right also. Otherwise when you start to highlight nodes with styles in the component's templates it won't match or it will match multiple times if there are controllers and actions of the same names but different areas. I just had to do that a second ago.

areas is now supported in version 1.0.2-rc20160901

I have also added an area to the demo app and included it in the navigation.xml file for reference