Well, after trying this a bunch of different ways, I'm unable to get this working. I'm not a programmer, so I can't figure out what's wrong. Thanks for the help.
Here is what I ultimately tried. NOTE: I commented out the portion you suggested to try something different because I was getting a Visual Studio warning that I was hiding "SubPaths()" by suppressing and therefore if I intended to hide it I should use "new" (which is what you see in my code "override new IEnumerable...":
[OrchardSuppressDependency("Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.BasicShapeTemplateHarvester")]
public class RemesqTemplateHarvester : BasicShapeTemplateHarvester
{
public new IEnumerable<string> SubPaths()
{
// Tried your suggest, but I got the same errors. NOTE: I got the "new" warning for "SubPaths() above
//var paths = base.SubPaths().ToList();
//paths.Add("Views/CustomFolder1");
//paths.Add("Views/CustomFolder2");
//return paths;
// Below is what appears in original file, so I thought I'd try it and add my new folders:
return new[] { "Views", "Views/Items", "Views/Parts", "Views/Fields", "Views/CustomFolder1", "Views/CustomFolder2" };
}
}
I had this in a controller:
public ActionResult MyShape()
{
var shape = _orchardServices.New.MyShape();
return new ShapeResult(this, shape);
}
And I added the .cshtml file to ~/Views/CustomFolder1/MyShape.cshtml.
I also tried
var shape = _orchardServices.New.CustomFolder1_MyShape();
In the end I got the same errors:
Shape type CustomFolder1_MyShape not found
Also NOTE: I receive the above error if I have a ~/CustomFolder1/MyShape RouteDescriptor in my Routes.cs file. If I delete that descriptor, I get a 404, resource not found, error. So I am not sure if I am doing something wrong (refer to the second sentence in this reply). :)
|