遵循 PiranhaCMS 2.2.0 文档不会将菜单项插入到管理器菜单中。
我究竟做错了什么?
我已经把它放在我的_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"
});
但是,即使代码被命中,我也可以看到其中Manager.Menu
包含新项目 - 它们不会在管理器菜单中呈现。
我在这里想念什么?我应该在哪里放置实际的菜单插入?
谢谢。