Plugin configuration route

3 months ago

v: 4.60.5

I'm migrating a v3.10 plugin to 4.60.5 and I want to setup the configuration page so it fits into the admin a bit cleaner. Previously i just used a basic empty page but i would like it to work like some others, e.g. paypal payment method, so basically it should use the admin layout etc.

What i'm getting is an error because its using my plugin controller name in the path when its looking for the the _ConfigurePlugin view.

I've looked at the paypal plugin and i cannot see its doing anything different - as far as the configure route goes. I'm probably missing something but not sure (i've not worked with nop since 3.10)

I've setup the route in the RouteProvider, I have a configure.cshtml and a Configure action on the controller. The controller action returns the relative path to the configure.cshtml. The configure.cshtml is using _ConfigureLayout for its layout. I see the paypal plugin does the same so i've copied that.

However this is where i get the error and its inserting my plugin controller name in to the path it uses to find the layout.

InvalidOperationException: The layout view '_ConfigurePlugin' could not be located. The following locations were searched:
/Themes/DefaultClean/Views/Suppliers/_ConfigurePlugin.cshtml
/Themes/DefaultClean/Views/Shared/_ConfigurePlugin.cshtml
/Views/Suppliers/_ConfigurePlugin.cshtml
/Views/Shared/_ConfigurePlugin.cshtml
/Pages/Shared/_ConfigurePlugin.cshtml



Thanks.
3 months ago
It's not needed to set up a route for the configure page.  
Look at an existing plugin.  Be sure to inherit from BasePaymentController - e.g.
\Plugins\Nop.Plugin.Payments.Manual\Controllers\PaymentManualController.cs
[AuthorizeAdmin]
[Area(AreaNames.Admin)]
[AutoValidateAntiforgeryToken]
public class PaymentManualController : BasePaymentController
3 months ago
aha! I was missing the controller attributes. Right in front of my nose and missed it.

Thanks.