Open orchardbot opened 13 years ago
evil_ commented:
When I implements INavigationProvider to build my own navigation menu from c# code, in this case Selected property works correct
evil_ commented:
Also Selected property isn't used in default MenuItem layout. The 'active' style set by equality of the browser link with navigation link.
evil_ commented:
I think it should have higher priority, cause it is actual to whole orchard. Another steps reproduce: 1) Go to /Admin/Users;
Result: Users menu is highlighted;
2) Got to /Admin/Users/Create
Result: Users menu is not highlighted;
This is my fix for MenuItem.cshtml:
var requestUrl = Request.Path.Replace(Request.ApplicationPath, string.Empty).TrimEnd('/').ToUpperInvariant(); var modelUrl = Model.Href.Replace(Request.ApplicationPath, string.Empty).TrimEnd('/').ToUpperInvariant(); if ((!string.IsNullOrEmpty(modelUrl) && (requestUrl.StartsWith(modelUrl) || requestUrl == modelUrl)) || (string.IsNullOrEmpty(modelUrl) && requestUrl == modelUrl)) { tabIsActive = true; }
evil_ created: https://orchard.codeplex.com/workitem/18122
Default navigation menu has a property named Selected which is always false.