Following the PiranhaCMS 2.2.0 documentation does not insert the menu items into the Manager menu.
What am I doing wrong?
I've placed this in my _AppStart.cshtml
Manager.Menu.Add(new Manager.MenuGroup()
{
InternalId = "MyApp",
Name = "My app",
CssClass = "fancy-icon"
});
/* From this point down - also tried placing in _ViewStart.cshtml */
Manager.Menu.Where(m => m.InternalId == "MyApp").Single().Items.Add(
new Manager.MenuItem() {
Name = "Products",
Action = "productlist",
Controller = "products",
Permission = "ADMIN_PRODUCT",
SelectedActions = "productlist,productedit"
});
Manager.Menu.Where(m => m.InternalId == "MyApp").Single().Items.Add(
new Manager.MenuItem() {
Name = "Product groups",
Action = "productgrouplist",
Controller = "products",
Permission = "ADMIN_PRODUCTGROUP",
SelectedActions = "productgrouplist,productgroupedit"
});
However, even though the code is hit, and I can see that the Manager.Menu
has the new items in it - they don't render in the Manager Menu.
What am I missing here? Where should I place the actual Menu inserts?
Thanks.