Generating Shapes with ShapeHelper in Orchard CMS - Type Not Found

送分小仙女□ 提交于 2019-12-06 07:26:16

Put your display template directly inside Views folder (/Views/Parts.SubscribersForm.cshtml), not inside DisplayTemplates. Orchard, by convention, scans Views folders only when looking for shape templates. That EditorTemplates subfolder, on the other hand, holds templates for part editors, ie. those shapes returned from driver Editor methods.

What is that dynamic shapeHelper thing? In short - it's a shape factory. When you call eg. shapeHelper.SomeShape(Foo: 1, Bar: "baz"), it returns a shape object that corresponds to a SomeShape.cshtml template, with a dynamic model containing properties Foo and Bar. That template has to reside somewhere in Views folder of a module or theme. That's more or less all the magic.

If you want to understand shapes more - it's a good starting point: http://docs.orchardproject.net/Documentation/Accessing-and-rendering-shapes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!