Adding admin views in a plugin breaks the navigation menu

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
I've added a plugin with 1 admin controller. This plugin adds a new item to the admin navigation menu. I can navigate and use the new views just fine, but once I'm viewing my new views I cannot use the admin menu to get back to other pages.

For example the dashboard link normally renders as http://admin-demo.nopcommerce.com/Admin,  but on my views it renders as http://admin-demo.nopcommerce.com/. I'm not sure what interaction is causing this, but I have not been able to correct it and the Telerik documentation lacks the behind the scenes information on how the links are constructed.

Below is a sample of the route I created as well and like I mentioned, all the pages load and work just fine, but once I'm on my new views I cannot use the admin menu and I need to type the urls in the browser navigation bar to get back to the admin dashboard. Any help or ideas would be appreciated.


            routes.MapRoute("MyNewRouteName",
                "<plugin name>/admin/",
                new { controller = "PluginAdmin", action = "Index" },
                new[] { "Plugin.Namespace.Controllers" });
12 years ago
How about the following code

            routes.MapRoute("MyNewRouteName",
                "<plugin name>/admin/",
                new { controller = "PluginAdmin", action = "Index", area = "Admin" },
                new[] { "Plugin.Namespace.Controllers" });

P.S. You can also try remove /admin/ from "<plugin name>/admin/" path
P.P.S. I haven't tested it
12 years ago
Skyler, Is this related to the  "url with 5 parts" issue?  (I see you on that thread, so maybe this is different)

https://www.nopcommerce.com/boards/t/12699/admin-plugin-route.aspx?p=2
12 years ago
New York wrote:
Skyler, Is this related to the  "url with 5 parts" issue?  (I see you on that thread, so maybe this is different)

https://www.nopcommerce.com/boards/t/12699/admin-plugin-route.aspx?p=2


@Andrei, thank you for the suggestions but they didn't work.


            routes.MapRoute("MyNewRouteName",
                "<plugin name>/admin/",
                new { controller = "PluginAdmin", action = "Index" },
                new[] { "Plugin.Namespace.Controllers" }).DataTokens.Add("area", "admin");


Fixed the issue. Thanks for the link New York! I stopped following the topic after the original issue was solved.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.