I have noticed that while building a module with an INavigationProvider which links to a custom controller (as per Part 10 of sfmskywalkers web tutorial at
http://skywalkersoftwaredevelopment.net/blog/writing-an-orchard-webshop-module-from-scratch-part-10), the admin menu behaves odd while developing.
For instance, when my controller contains an error and I click on the admin menu, I get thrown out of the Dashboard and I land on a "Not Found"-page. When I then go back to the Dashboard and click the admin menu again, it seems as if the anchor-link of the admin menu has no href associated with it, as I simpy open the current admin page again. I can only solve this by changing the position of the admin menu item in the INavigationProvider based class (in the below code by switching "Doopsuiker"and "Fotografie" from 2.1 to 2.2 and reverse). After that, everything works smoothly again. This is my AdminMenu.cs:
public class AdminMenu : INavigationProvider
{
#region Construction/Destruction
public AdminMenu()
{
T = NullLocalizer.Instance;
}
#endregion Construction/Destruction
#region Methods
public void GetNavigation(NavigationBuilder builder)
{
builder
// Image set
.AddImageSet("webshop")
// "Webshop"
.Add(item => item
.Caption(T("Webshop"))
.Position("2")
.LinkToFirstChild(true)
// "Doopsuiker"
.Add(subItem => subItem
.Caption(T("Doopsuiker"))
.Position("2.1")
.Action("Index", "DoopsuikerAdmin", new { area = "Orchard.Ekalaya" })
)
// "Fotografie"
.Add(subItem => subItem
.Caption(T("Fotografie"))
.Position("2.2")
.Action("Index", "FotografieAdmin", new { area = "Orchard.Ekalaya" })
)
);
}
#endregion Methods
#region Accessors
public Localizer T { get; set; }
public string MenuName { get { return "admin"; } }
#endregion Accessors
}