mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Getting the routable display to work and added a display part template (for the title)
- the title should probably be linked - would it be useful for some route part properties to be on the model (for Model.Title) or is there already an easy way to get at that? --HG-- branch : theming
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
<article>
|
||||||
|
<header>
|
||||||
|
@Display(Model.Header)
|
||||||
|
</header>
|
||||||
|
<section>
|
||||||
|
@Display(Model.primary)
|
||||||
|
</section>
|
||||||
|
</article>
|
||||||
@@ -307,6 +307,7 @@
|
|||||||
<Content Include="PublishLater\Styles\ui.timepickr.css" />
|
<Content Include="PublishLater\Styles\ui.timepickr.css" />
|
||||||
<Content Include="PublishLater\Views\EditorTemplates\Parts\PublishLater.ascx" />
|
<Content Include="PublishLater\Views\EditorTemplates\Parts\PublishLater.ascx" />
|
||||||
<Content Include="Reports\Module.txt" />
|
<Content Include="Reports\Module.txt" />
|
||||||
|
<None Include="Contents\Views\Items\Content.Detail.cshtml" />
|
||||||
<None Include="Reports\Views\Admin\Display.cshtml" />
|
<None Include="Reports\Views\Admin\Display.cshtml" />
|
||||||
<None Include="Reports\Views\Admin\Index.cshtml" />
|
<None Include="Reports\Views\Admin\Index.cshtml" />
|
||||||
<Content Include="Localization\Module.txt" />
|
<Content Include="Localization\Module.txt" />
|
||||||
@@ -317,6 +318,7 @@
|
|||||||
<Content Include="Routable\Scripts\jquery.slugify.js" />
|
<Content Include="Routable\Scripts\jquery.slugify.js" />
|
||||||
<None Include="Routable\Views\EditorTemplates\Parts\Routable.RoutePart.cshtml" />
|
<None Include="Routable\Views\EditorTemplates\Parts\Routable.RoutePart.cshtml" />
|
||||||
<None Include="Routable\Views\Item\Display.cshtml" />
|
<None Include="Routable\Views\Item\Display.cshtml" />
|
||||||
|
<None Include="Routable\Views\DisplayTemplates\Parts\Routable.RoutePart.cshtml" />
|
||||||
<Content Include="Settings\Module.txt" />
|
<Content Include="Settings\Module.txt" />
|
||||||
<Content Include="Settings\Styles\admin.css" />
|
<Content Include="Settings\Styles\admin.css" />
|
||||||
<None Include="Settings\Views\Admin\Index.cshtml" />
|
<None Include="Settings\Views\Admin\Index.cshtml" />
|
||||||
|
|||||||
@@ -43,6 +43,17 @@ namespace Orchard.Core.Routable.Drivers {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override DriverResult Display(RoutePart part, string displayType) {
|
||||||
|
var model = new RoutableDisplayViewModel {RoutePart = part};
|
||||||
|
var location = part.GetLocation(displayType);
|
||||||
|
|
||||||
|
//todo: give this part a default location
|
||||||
|
if (location == null || location.Zone == null)
|
||||||
|
location = new ContentLocation {Position = "5", Zone = "Header"};
|
||||||
|
|
||||||
|
return ContentPartTemplate(model, TemplateName, Prefix).LongestMatch(displayType, "Summary", "SummaryAdmin").Location(location);
|
||||||
|
}
|
||||||
|
|
||||||
protected override DriverResult Editor(RoutePart part) {
|
protected override DriverResult Editor(RoutePart part) {
|
||||||
var model = new RoutableEditorViewModel {
|
var model = new RoutableEditorViewModel {
|
||||||
ContentType = part.ContentItem.ContentType,
|
ContentType = part.ContentItem.ContentType,
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
using Orchard.ContentManagement.Aspects;
|
using Orchard.Core.Routable.Models;
|
||||||
|
|
||||||
namespace Orchard.Core.Routable.ViewModels {
|
namespace Orchard.Core.Routable.ViewModels {
|
||||||
#if REFACTORING
|
|
||||||
public class RoutableDisplayViewModel {
|
public class RoutableDisplayViewModel {
|
||||||
public ContentItemViewModel<IRoutableAspect> Routable {get;set;}
|
public string Title { get { return RoutePart.Title; } }
|
||||||
|
public RoutePart RoutePart { get; set; }
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
@model Orchard.Core.Routable.ViewModels.RoutableDisplayViewModel
|
||||||
|
<h1>@Model.Title</h1>
|
||||||
@@ -1,3 +1,2 @@
|
|||||||
@model Orchard.Core.Routable.ViewModels.RoutableDisplayViewModel
|
@//Html.AddTitleParts((string)Model.Routable.Item.Title);
|
||||||
@Html.AddTitleParts(Model.Routable.Item.Title);
|
@Display(Model)
|
||||||
@Display(Model.Routable)
|
|
||||||
Reference in New Issue
Block a user