0

I am new to orchard i had made a simple module using MVC and Entity Frame work ..The module is simple Crud application.I had integerated this module on my orchard site and this module works fine on front end.But i had problem how to configure same module on admin panel in orchard i want to do these functionalities on admin site

4

1 回答 1

0

创建一个名为 AdminController 的控制器或使用 [Admin] 属性装饰一个控制器(使用 Orchard.UI.Admin)。

然后要创建一个菜单项,使用以下代码在项目的路径中创建一个名为 AdminMenu.cs 的文件:

using Orchard.Localization;
using Orchard.UI.Navigation;

namespace MyFirstModule {
    public class AdminMenu : INavigationProvider {
        public Localizer T { get; set; }
        public string MenuName { get { return "admin"; } }

        public void GetNavigation(NavigationBuilder builder) {
            builder.Add(T("My admin menu item"), "50",
                menu => menu.Add(T("My admin menu item"), "20", item => item.Action("Index", "Admin", new { area = "MyFirstModule" })
                    .Permission(Permissions.ConfigureRobotsTextFile)));
        }
    }
}

这将添加一个链接到您的操作的菜单项。然后你可以做任何你想做的管理工作:)

于 2013-07-04T12:32:04.560 回答