Orchard extended custom background management navigation Menu Admin Menu, orchard navigation Menu
Jin Tian: to learn a new thing, you must embrace it. If you stick to your previous concept system, you will feel difficult.Golden day:Viewing the source code is always the fastest way for Coder to learn.Jin Tian: 15998603918 welcome to chat with me. Reading this article requires a certain understanding of the Orchard general system, especially the Module plug-in system. Orchard Admin Menu to customize the background management navigation Menu, you only need to implement the interface INavigationProvider in your Module, as shown in. All that needs to be done is simple, like adding AdminMenu to implement the INavigationProvider interface. 99% of the logic is defined in GetNavigation (NavigationItemBuilder builder) menu title definition menu link definition menu position definition menu style and so on here there is a non-standard logic, the author here is called dirty logic: position (string position), normal sorting, for example,-2,-1, 1, 2, 3. If it is set to before or null, it is-9999, if you want to rank first, you need to be smaller than-9999. If you want to set it to "after", it will be 9999. If you want to rank later, you need to be greater than 9999. Note: 1. for more details about how to implement GetNavigation, refer to all the classes that implement the INavigationProvider interface in the source code. Looking at the source code is always a shortcut to coder learning. 2. Here I implement RecentMenus, which is to top the Menu from the last four points. The effect is as follows: IActionFilter is used in the middle.