I'm using nopCommerce 3.90 with source.
I created a plugin that adds a menu option to the end of the Admin menu. When it executes the method called by the new menu option, the admin sidebar-menu disappears and all of the other text on the screen as well. My view text appears, but on one big blank screen.
How do I allow my view to display without losing the rest of the Admin screen with all of the menu options etc.?
Here is my Plugin:
using Nop.Core.Plugins;
using Nop.Services.Common;
using Nop.Web.Framework.Menu;
using System;
using System.Linq;
using System.Web.Routing;
namespace Nop.Plugin.Misc.LakesideImport
{
public class LakesideImportPlugin : BasePlugin, IMiscPlugin, IAdminMenuPlugin
{
public void ManageSiteMap(SiteMapNode rootNode)
{
var menuItem = new SiteMapNode()
{
SystemName = "Misc.LakesideImport",
Title = "Lakeside Import",
ControllerName = "LakesideImport",
ActionName = "ImportProductFile",
Visible = true,
RouteValues = new RouteValueDictionary() { { "area", null } }
};
var pluginNode = rootNode.ChildNodes.FirstOrDefault(x => x.SystemName == "Third party plugins");
if (pluginNode != null)
pluginNode.ChildNodes.Add(menuItem);
else
rootNode.ChildNodes.Add(menuItem);
//throw new NotImplementedException();
}
public override void Install()
{
base.Install();
}
public override void Uninstall()
{
base.Uninstall();
}
public void GetConfigurationRoute(out string actionName, out string controllerName, out RouteValueDictionary routeValues)
{
actionName = "Configure";
controllerName = "LakesideImport";
routeValues = new RouteValueDictionary { { "Namespaces", "Nop.Plugin.Misc.LakesideImport.Controllers" }, { "area", null } };
//throw new NotImplementedException();
}
}
}
Here is my Controller:
using Nop.Web.Framework.Controllers;
using System.Web.Mvc;
namespace Nop.Plugin.Misc.LakesideImport.Controllers
{
[AdminAuthorize]
public class LakesideImportController : BasePluginController
{
public ActionResult Configure()
{
return View("~/Plugins/Misc.LakesideImport/Views/MiscLakesideImport/Configure.cshtml");
}
public virtual ActionResult ImportProductFile()
{
return View("~/Plugins/Misc.LakesideImport/Views/MiscLakesideImport/ImportProductFile.cshtml");
}
}
}
Here is my View:
@{
Layout = "";
}
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-body">
<p>
You have reached the start screen for the Lakeside Import of ProductFile.
</p>
</div>
</div>
</div>
Any help that anyone can provide would be gratefully appreciated.
Thanks,
Tony