How to override Plugin view in theme ?

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

Now I want to override the NivoSlider  plugin view in my own theme , it seems the plugin view return physical path ,it only search the plugin folder , so  is it possible to make the view themeable  ,like ~/{Theme}/Plugins/Widgets.NivoSlider/Views/PublicInfo.cshtml' ?

i am using nop 4.0 (not released ).

InvalidOperationException: The view 'Components/WidgetsNivoSlider/~/Plugins/Widgets.NivoSlider/Views/PublicInfo.cshtml' was not found. The following locations were searched:
~/Plugins/Widgets.NivoSlider/Views/PublicInfo.cshtml



Thanks very much !
4 years ago
I have the same issue in 4.20.
Anyone have a solution?
4 years ago
Marwa wrote:
Anyone have a solution?

Depending on your knowledge, you may modify only PublicInfo.cshtml file by adding if condition or modify sources of the plugin. With code below you may get information, which theme is currently used. Code will allow to build custom part of default file path.
string currentThemeName = EngineContext.Current.Resolve<IThemeContext>().WorkingThemeName;

Since sources are available for NivoSlider, you may implement above code and change default path to be related to used theme.

Regards,
Tom
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.