I'm building a site using Orchard CMS and creating my own custom modules. I have been following a couple of tutorials and so-far-so-good.
I don't understand how the .ShapeHelper() method works and it's giving me a little trouble.
The following code, from my Driver file, works perfectly fine and generates my view on the front-end.
protected override DriverResult Display(SubscribersFormPart part, string displayType, dynamic shapeHelper)
{
// setup model
part.DateStamp = System.DateTime.Now;
return ContentShape("Parts_SubscribersForm", () => shapeHelper.DisplayTemplate(TemplateName: "Parts/SubscribersForm", Model: part, Prefix: Prefix));
}
However, I have seen on other tutorials that rather than DisplayTemplate
the name of the part/view is used instead..which is what I would rather as especially when using the Shape Tracing module it's getting a little confusing seeing "DisplayTemplate" (as in the image below..) rather than a more recognisable name
I have tried simply changing my method to:
protected override DriverResult Display(SubscribersFormPart part, string displayType, dynamic shapeHelper)
{
// setup model
part.DateStamp = System.DateTime.Now;
return ContentShape("Parts_SubscribersForm", () => shapeHelper.Parts_SubscribersForm(TemplateName: "Parts/SubscribersForm", Model: part, Prefix: Prefix));
}
- notice the "Parts_SubscribersForm()" - though when I do this I get the following error...
I believe it is to do with where my views are located, though I also believe I have these in the correct folders that Orchard requires. This is my folder structure where my views are concerned...
Can anybody point me in the right direction - where I can use my parts name in the shapeHelper method, rather than "DisplayContent"?