Writing plugin with admin page inside

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Il y a 12 ans
Hi;

I'm trying to write a slider plugin on nopcommerce 2.30. I have to add two views: one view is admin page which users upload banners for plugin. Another is ambeded view to show up banner on main page.

When I'm looking plugins which was made by nop team, their admin page are not inside the plugin project. For example Admin page for ExthernalAuthentication is inside the nop.admin project.

In conclusion, I'm looking for a solution or sample plugin which has admin page inside.

Thanks.
Il y a 12 ans
mavera wrote:
Hi;

I'm trying to write a slider plugin on nopcommerce 2.30. I have to add two views: one view is admin page which users upload banners for plugin. Another is ambeded view to show up banner on main page.

When I'm looking plugins which was made by nop team, their admin page are not inside the plugin project. For example Admin page for ExthernalAuthentication is inside the nop.admin project.

In conclusion, I'm looking for a solution or sample plugin which has admin page inside.

Thanks.


Mavera you should just create a view like you normally would, but specify the admin layout and add the  [AdminAuthorize] attribute to your admin action. Verify that if you login as a basic user you cannot change the URL and look at the view.
Il y a 12 ans
Thanks for your reply. Then how can I create a menu to navigate to that page? Direck adding a menu to sitemap.xml is not working.

Ex: I write controller like "TestPlugin" and action "Configure" to xml. Then when I click that menu on run time, It navigate me to localhost/nop/Admin/TestPlugin/Configure. But I expect  localhost/nop/TestPlugin/Configure.

Thanks
Il y a 12 ans
mavera wrote:
Thanks for your reply. Then how can I create a menu to navigate to that page? Direck adding a menu to sitemap.xml is not working.

Ex: I write controller like "TestPlugin" and action "Configure" to xml. Then when I click that menu on run time, It navigate me to localhost/nop/Admin/TestPlugin/Configure. But I expect  localhost/nop/TestPlugin/Configure.

Thanks


In your plugin create a new class that implements the interface Nop.Web.Framework.Web.IAdminMenuPlugin. When you implement this class correctly it will add a new menu item in the administration section.
Il y a 12 ans
Thanks a lot @skyler.severns. I'll try it.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.