Hello.
I am trying to add a new category template, which should be found in my plugin.
I guess i could just add the full path to the category template path, but i would like to use the ExpandViewLocation to achive this instead.
When i navigate to a category with the selected template, it searches through many locations(theme, different nop-templates plugins etc), but not the location of my plugin.
I have the following code:
public class ViewLocationExpander : IViewLocationExpander
{
public void PopulateValues(ViewLocationExpanderContext context)
{
}
public IEnumerable<string> ExpandViewLocations(ViewLocationExpanderContext context, IEnumerable<string> viewLocations)
{
viewLocations = new string[] { $"/Plugins/CUSTOM.MyPlugin/Views/{{0}}.cshtml",
$"/Plugins/CUSTOM.MyPlugin/Views/Shared/{{0}}.cshtml"}.Concat(viewLocations);
return viewLocations;
}
}