I have a nopCommerce plugin which has a custom view engine as following:
CustomViewEngine : ThemeableRazorViewEngine
The plugin has a view file called CategoryNavigation.cshtml
which also exists at Views\Catalog\CategoryNavigation.cshtml
Now if I delete the files the error reported by the view engines are as following:
As you can see the first searched location is the plugin folder.
So if the file exists in the plugin folder but not in the Views\Catalog\
folder then it is displayed from the plugin folder without any error.
But if the file exists both in the plugin folder and in Views\Catalog\
then the view from the Views\Catalog\
is rendered. But the Views\Catalog\
is way down in the search locations (see the image above).
Any idea what might be causing the issue?
nopCommerce 3.70
If you want to display view page form your plugin, you should use plugin view engine, that you've already done. But make sure you also define
ViewLocationFormats
like following.Here create a folder(catalog) in your view folder and paste
categoryNavigation.cshtml
into it.It will display view page from your plugin instead of default.
Hope this will help to you!
For more information refer this: Ways to Display Views in Your nopCommerce Plugins