mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
rough concept work around some item template zones
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4043037
This commit is contained in:
@@ -4,10 +4,10 @@ using Orchard.Models.ViewModels;
|
||||
namespace Orchard.DevTools.Models {
|
||||
public class DebugLinkProvider : ContentProvider {
|
||||
protected override void GetDisplays(GetDisplaysContext context) {
|
||||
context.AddDisplay(new TemplateViewModel(new ShowDebugLink { ContentItem = context.ContentItem }) { Position = "10" });
|
||||
context.AddDisplay(new TemplateViewModel(new ShowDebugLink { ContentItem = context.ContentItem }) { ZoneName = "last", Position = "10" });
|
||||
}
|
||||
protected override void GetEditors(GetEditorsContext context) {
|
||||
context.AddEditor(new TemplateViewModel(new ShowDebugLink { ContentItem = context.ContentItem }) { Position = "10" });
|
||||
context.AddEditor(new TemplateViewModel(new ShowDebugLink { ContentItem = context.ContentItem }) { ZoneName = "last", Position = "10" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,14 +1,22 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ItemDisplayViewModel<SandboxPage>>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html" %>
|
||||
<%@ Import Namespace="Orchard.Sandbox.Models" %>
|
||||
<%@ Import Namespace="Orchard.Models.ViewModels" %>
|
||||
<%@ Import Namespace="Orchard.Models" %>
|
||||
|
||||
<h1><%=Html.Encode(Model.Item.Record.Name) %></h1>
|
||||
|
||||
<%foreach (var display in Model.Displays) { %>
|
||||
<%=Html.DisplayFor(m=>display.Model, display.TemplateName, display.Prefix) %>
|
||||
<%} %>
|
||||
|
||||
<p>
|
||||
<%=Html.ItemEditLink("Edit this page", Model.Item) %>, <%=Html.ActionLink("Return to list", "index") %></p>
|
||||
<%=Html.DisplayZone("before")%>
|
||||
<div class="item">
|
||||
<%=Html.DisplayZone("first")%>
|
||||
<h1>
|
||||
<%=Html.Encode(Model.Item.Record.Name) %></h1>
|
||||
<%=Html.DisplayZone("metatop")%>
|
||||
<div class="body">
|
||||
<%=Html.DisplayZone("body")%></div>
|
||||
<%=Html.DisplayZone("metabottom")%>
|
||||
<div class="actions">
|
||||
<%=Html.ItemEditLink("Edit this page", Model.Item) %>,
|
||||
<%=Html.ActionLink("Return to list", "index") %>
|
||||
<%=Html.DisplayZone("actions") %></div>
|
||||
<%=Html.DisplayZonesExcept("last","after") %>
|
||||
<%=Html.DisplayZone("last")%>
|
||||
</div>
|
||||
<%=Html.DisplayZone("after")%>
|
||||
|
@@ -20,8 +20,7 @@
|
||||
</div>
|
||||
<div id="main">
|
||||
<% Html.RenderPartial("Messages", Model.Messages); %>
|
||||
<h3>
|
||||
Edit Page</h3>
|
||||
<h3>Edit Page</h3>
|
||||
<%using (Html.BeginForm()) { %>
|
||||
<%=Html.EditorForItem(m=>m.Page) %>
|
||||
<input type="submit" name="submit" value="Save" />
|
||||
|
@@ -27,8 +27,8 @@ namespace Orchard.Tags.Models {
|
||||
Filters.Add(new ActivatingFilter<HasTags>("blogpost"));
|
||||
|
||||
OnGetDisplays<HasTags>((context, hasTags) => {
|
||||
context.AddDisplay(new TemplateViewModel(hasTags) { Position = "2", TemplateName = "HasTagsList" });
|
||||
context.AddDisplay(new TemplateViewModel(hasTags) { Position = "5" });
|
||||
context.AddDisplay(new TemplateViewModel(hasTags) { ZoneName="metatop", Position = "2", TemplateName = "HasTagsList" });
|
||||
context.AddDisplay(new TemplateViewModel(hasTags) { ZoneName = "metabottom", Position = "5" });
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user