Plugin master view cannot be found

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
Hi!,

I've been creating a plugin for shipping that requires multiple controllers. I was able to associate the master view my first action since it is called from the admin side. The problem lies when I tried to call another action from my first controller. The area is set to plugin and I cannot use the master view on any of the views. Is there a way to use the master view on the plugins?

Thanks in advance
11 years ago
rycrl_bljd wrote:
Hi!,

I've been creating a plugin for shipping that requires multiple controllers. I was able to associate the master view my first action since it is called from the admin side. The problem lies when I tried to call another action from my first controller. The area is set to plugin and I cannot use the master view on any of the views. Is there a way to use the master view on the plugins?

Thanks in advance


Show us your code to better describe the question. :)
11 years ago
It's like this, I got 2 controllers in my plugin. Controller1 and Controller2. I got a List view on both of my contollers.

Controller1 action List is called from the configure provider of the plugin manager.
Its view still shows the nopcommerce admin master view.

Controller2 action List is called from the List in Controller1. The Url changed from ../admin/Controller1/List to ../plugin/Controller2/List. On the List view, the admin master view cannot be used. The view is just a plain white background when I access it.

I don't think my code can help if i show it here.
11 years ago
I think this is the reason why the default plugins use a single controller.
11 years ago
rycrl_bljd wrote:
It's like this, I got 2 controllers in my plugin. Controller1 and Controller2. I got a List view on both of my contollers.

Controller1 action List is called from the configure provider of the plugin manager.
Its view still shows the nopcommerce admin master view.

Controller2 action List is called from the List in Controller1. The Url changed from ../admin/Controller1/List to ../plugin/Controller2/List. On the List view, the admin master view cannot be used. The view is just a plain white background when I access it.

I don't think my code can help if i show it here.

I think this is the reason why the default plugins use a single controller.


Ok. I can't really understand your explanation, but let me guess:

You got 2 controllers, both contains a List action. One List action is referenced by the Configure plugin route, and the View for this action has a link to the List action of Controller 2. But on the List action of Controller 2, you can't see the default Administration theme, all you see is a plain, unstyled page with a white background.

If this is the case, and what you want to do is for the List action in Controller 2 to have the Administration theme, just add the following code to your Controller 2 Views:


@{
    Layout = "~/Administration/Views/Shared/_AdminLayout.cshtml";
}


:)
11 years ago
Thanks wooncherk, that solves the problem.
11 years ago
rycrl_bljd wrote:
Thanks wooncherk, that solves the problem.


Welcome. :D
11 years ago
I got a new problem with this setup. Most of the menu tabs are not working. I changed the Route of the plugin to work on /Plugins/Freight but when I try to navigate to the other pages, the route provider omits the /Admin part of the url. How can I make this work?
11 years ago
rycrl_bljd wrote:
I got a new problem with this setup. Most of the menu tabs are not working. I changed the Route of the plugin to work on /Plugins/Freight but when I try to navigate to the other pages, the route provider omits the /Admin part of the url. How can I make this work?


Try this, I've explained in this post. :D

https://www.nopcommerce.com/boards/t/20478/broken-menus-in-admin-area-whilst-trying-to-make-a-plugin-admin-page.aspx
11 years ago
wooncherk wrote:
I got a new problem with this setup. Most of the menu tabs are not working. I changed the Route of the plugin to work on /Plugins/Freight but when I try to navigate to the other pages, the route provider omits the /Admin part of the url. How can I make this work?

Try this, I've explained in this post. :D

https://www.nopcommerce.com/boards/t/20478/broken-menus-in-admin-area-whilst-trying-to-make-a-plugin-admin-page.aspx


Thanks man, you're a great help.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.