0
votes

I would like to add a new part to orchard administration area,

I need an iframe in this part, that shows another page in another website.

*page, and other custom content type is not what I need.

Is it possible to create something like that?

Thanks,

NadavSt

1

1 Answers

0
votes

Perfectly possible.

You will need a custom module. With a controller called AdminController.

Add a method called Index and a new view in the views folder called Index.cshtml and do whatever you want in there.

public ActionResult Index() {
    //do stuff...

    return View();
}

Then to create a link to it in the menu, add a file called AdminMenu.cs in the root of your module with something like the following.

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 Area"), "4", item => item.Action("Index", "Admin", new { area = "Orchard.MyModule" }).Permission(StandardPermissions.SiteOwner));
   }
}

So that creates a item in the menu called "My Admin Area" at position 4 that links to a method called Index in the Admin controller. You can add permissions so the item only appears for those users with that permission. Make sure you protect your action in the controller as well.

I would recommend checking random Core modules to see how they do stuff, it is the best way to see how things work and get examples. Most modules implement the functionality you are after.

Good luck :)