OrchardCMS / OrchardDoc

Documentation for Orchard 1.x (not Orchard Core, for that see https://docs.orchardcore.net/).
http://docs.orchardproject.net
142 stars 242 forks source link

wrapper content seems to be wrong #306

Open rtpHarry opened 7 years ago

rtpHarry commented 7 years ago

http://docs.orchardproject.net/en/latest/Documentation/Understanding-placement-info/#wrapper

Says:

Create this file and put the following text in it:

<div class="htmlWrapperContent">
    @Model.Html
</div>

But it seems like it's

@Display(Model.Metadata.ChildContent)

Not sure if that's in every case or not. I was working with a Part (Orchard.Cw.Disqus) but I found discussion on the web saying that it also worked for Fields.

rtpHarry commented 7 years ago

Some of the wrappers use this shape from CoreShapes.cs:

    [Shape]
    public IHtmlString PlaceChildContent(dynamic Source) {
        return Source.Metadata.ChildContent;
    }

Which is used like @Display.PlaceChildContent(Source: Model)

This seems like an attempt to standardise it.

Some (widgets and elements) provide a shortcut on their shape under .Child which is implemented in the modules IShapeTableProvider like this.