mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Making the content wrapper not apply to *Admin* display types and making the wrapper zone names containing the child contents consistent (Model.Child)
--HG-- branch : dev
This commit is contained in:
@@ -5,10 +5,9 @@ namespace Orchard.Core.Contents {
|
||||
public class Shapes : IShapeTableProvider {
|
||||
public void Discover(ShapeTableBuilder builder) {
|
||||
builder.Describe("Content")
|
||||
.Configure(descriptor => descriptor.Wrappers.Add("Content_ControlWrapper"))
|
||||
.OnCreated(created => {
|
||||
var content = created.Shape;
|
||||
content.Main.Add(created.New.PlaceChildContent(Source: content));
|
||||
content.Child.Add(created.New.PlaceChildContent(Source: content));
|
||||
})
|
||||
.OnDisplaying(displaying => {
|
||||
ContentItem contentItem = displaying.Shape.ContentItem;
|
||||
@@ -21,6 +20,9 @@ namespace Orchard.Core.Contents {
|
||||
displaying.ShapeMetadata.Alternates.Add("Content_" + displaying.ShapeMetadata.DisplayType);
|
||||
//Content.Summary-Page
|
||||
displaying.ShapeMetadata.Alternates.Add("Content_" + displaying.ShapeMetadata.DisplayType + "__" + contentItem.ContentType);
|
||||
|
||||
if (!displaying.ShapeMetadata.DisplayType.Contains("Admin"))
|
||||
displaying.ShapeMetadata.Wrappers.Add("Content_ControlWrapper");
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -3,9 +3,9 @@
|
||||
@if (AuthorizedFor(Permissions.EditContent)) {
|
||||
<div class="content-control">
|
||||
<div class="manage-actions">@Html.ItemEditLinkWithReturnUrl(T("Edit").Text, (ContentItem)Model.ContentItem)</div>
|
||||
@Display(Model.Main)
|
||||
@Display(Model.Child)
|
||||
</div>
|
||||
}
|
||||
else {
|
||||
@Display(Model.Main)
|
||||
@Display(Model.Child)
|
||||
}
|
@@ -14,7 +14,7 @@ namespace Orchard.Widgets {
|
||||
})
|
||||
.OnCreated(created => {
|
||||
var widget = created.Shape;
|
||||
widget.Main.Add(created.New.PlaceChildContent(Source: widget));
|
||||
widget.Child.Add(created.New.PlaceChildContent(Source: widget));
|
||||
})
|
||||
.OnDisplaying(displaying => {
|
||||
ContentItem contentItem = displaying.Shape.ContentItem;
|
||||
|
@@ -3,9 +3,9 @@
|
||||
@if (AuthorizedFor(Permissions.ManageWidgets)) {
|
||||
<div class="widget-control">
|
||||
<div class="manage-actions">@Html.ItemEditLinkWithReturnUrl(T("Edit").Text, (ContentItem)Model.ContentItem)</div>
|
||||
@Display(Model.Main)
|
||||
@Display(Model.Child)
|
||||
</div>
|
||||
}
|
||||
else {
|
||||
@Display(Model.Main)
|
||||
@Display(Model.Child)
|
||||
}
|
@@ -8,7 +8,7 @@
|
||||
<h1>@title</h1>
|
||||
@Display(Model.Header)
|
||||
</header>
|
||||
@Display.PlaceChildContent(Source: Model)
|
||||
@Display(Model.Child)
|
||||
@if(Model.Footer != null) {
|
||||
<footer>
|
||||
@Display(Model.Footer)
|
||||
|
Reference in New Issue
Block a user