The problem is when I'm using ViewLocationExpander to find the view from the mentioned location, it's not working. Because same view is exists within the theme folder. ViewLocationExpander works perfectly for those which has no default view within theme folder. So, I' want to override the default path. The default path is mentioned within ThemeableViewLocationExpander (Nop.Web.Framework.Themes).
My ViewLocationExpander:
public IEnumerable<string> ExpandViewLocations(ViewLocationExpanderContext context, IEnumerable<string> viewLocations)
{
if (context.Values.TryGetValue(THEME_KEY, out string theme))
{
viewLocations = new string[] { $"/Themes/{theme}/Views/{Constants.PluginName}/Shared/"+splitcomp+".cshtml"
}.Concat(viewLocations);
}
return viewLocations;
}
}
Startup.cs:
public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
{
services.Configure<RazorViewEngineOptions>(options =>
{
options.ViewLocationExpanders.Add(new PluginViewExpander());
});
}
How to override this path? am I missing somthing?
Thanks in Advance.