0


我想覆盖Container.cshtml此路径Orchard.Core\Containers(folder)\Views\EditorTemplates\Container.cshtml
中的视图:到此路径中的视图:
MyModule\\Views\EditorTemplates\MyContainer.cshtml

现在!,我IShapeTableProvider为此目的实现了接口:

public class MyShapeProvider : IShapeTableProvider
    {
        public void Discover(ShapeTableBuilder builder)
        {
            builder.Describe("Container")
                .OnDisplaying(displaying =>
                {
                    displaying.ShapeMetadata.Alternates
                        .Add("Container_MyContainer");
                });
        }
    }

该代码是在项目的启动时间调用的,但不要工作!
对不对?

谢谢你的帮助!

4

1 回答 1

1

为了让您的模块优先,您必须在 module.txt 中覆盖要覆盖的模块:

Dependencies: Containers

这样你就可以让 Orchard 知道你想要使用模块的功能,并且你可以覆盖它。

于 2015-09-22T09:22:54.720 回答