mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-03 12:03:51 +08:00
Getting display in order for the (routable-specified) home page
--HG-- branch : theming
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
@{
|
||||
//home page content - should fall back to items/content so this template is optional (e.g. in a theme)
|
||||
}
|
||||
<article>
|
||||
<header>
|
||||
@Display(Model.Header)
|
||||
</header>
|
||||
<section>
|
||||
@Display(Model.primary)
|
||||
</section>
|
||||
</article>
|
||||
@@ -1,11 +0,0 @@
|
||||
@model dynamic
|
||||
<section style="background:#AAA;color:#000;padding:10px;">
|
||||
<h1>HomePage shape template</h1>
|
||||
<h2>I am the home page</h2>
|
||||
<dl>
|
||||
<dt>content item id</dt>
|
||||
<dd>@Display(Model.Id)</dd>
|
||||
<dt>the hard way to get at the raw body text</dt>
|
||||
<dd>@Display(Model.Parts[3].Text)</dd>
|
||||
</dl>
|
||||
</section>
|
||||
@@ -297,6 +297,7 @@
|
||||
<Content Include="PublishLater\Styles\ui.timepickr.css" />
|
||||
<Content Include="PublishLater\Views\EditorTemplates\Parts\PublishLater.ascx" />
|
||||
<Content Include="Reports\Module.txt" />
|
||||
<None Include="Contents\Views\Items\Content-HomePage.cshtml" />
|
||||
<None Include="Reports\Views\Admin\Display.cshtml" />
|
||||
<None Include="Reports\Views\Admin\Index.cshtml" />
|
||||
<Content Include="Localization\Module.txt" />
|
||||
@@ -335,6 +336,7 @@
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="XmlRpc\Module.txt" />
|
||||
<None Include="Shapes\Views\Display.cshtml" />
|
||||
<None Include="Shapes\Views\Menu.ascx_" />
|
||||
<None Include="XmlRpc\Views\Home\Index.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -395,14 +397,12 @@
|
||||
<None Include="Contents\Views\Items\Content.Edit.cshtml" />
|
||||
<None Include="Contents\Views\Items\Content.Summary.cshtml" />
|
||||
<None Include="Contents\Views\Items\Content.SummaryAdmin.cshtml" />
|
||||
<None Include="HomePage\Views\HomePage.cshtml" />
|
||||
<None Include="Shapes\Views\ContentZone.cshtml" />
|
||||
<None Include="Shapes\Views\DocumentZone.cshtml" />
|
||||
<None Include="Shapes\Views\Document.cshtml" />
|
||||
<None Include="Shapes\Views\User.cshtml" />
|
||||
<None Include="Shapes\Views\Header.cshtml" />
|
||||
<None Include="Shapes\Views\Layout.cshtml" />
|
||||
<None Include="Shapes\Views\Menu.ascx_" />
|
||||
<None Include="Shapes\Views\Menu.cshtml" />
|
||||
<None Include="Shapes\Views\MenuItem.cshtml" />
|
||||
<None Include="Shapes\Views\Messages.ascx_" />
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Web.Mvc;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.Core.Routable.Models;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Localization;
|
||||
@@ -38,11 +37,11 @@ namespace Orchard.Core.Routable.Services {
|
||||
if (contentItem == null || !contentItem.Is<RoutePart>())
|
||||
return new NotFoundResult();
|
||||
|
||||
var model = _contentManager.BuildDisplayModel(contentItem, "Detail");
|
||||
var model = _contentManager.BuildDisplayModel(contentItem, "_HomePage");
|
||||
|
||||
return new ViewResult {
|
||||
//ViewName = "~/Core/Routable/Views/Item/Display.ascx",
|
||||
ViewData = new ViewDataDictionary<dynamic>(Shape.HomePage(model))
|
||||
ViewName = "Display",
|
||||
ViewData = new ViewDataDictionary<dynamic>(model)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,6 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Config\Sample.Host.config" />
|
||||
<None Include="Themes\Contoso\Views\Header.ascx_" />
|
||||
<None Include="Themes\Contoso\Views\HomePage\Home\Index.cshtml" />
|
||||
<None Include="Themes\Contoso\Views\Layout.ascx_" />
|
||||
<None Include="Themes\Contoso\Views\Layout.HomePage.ascx_" />
|
||||
<None Include="Themes\SafeMode\Views\DocumentZone.cshtml" />
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
@model dynamic
|
||||
<section style="background:#666;color:#fff;padding:10px;">
|
||||
<h1>HomePage action template</h1>
|
||||
@Display(Model)
|
||||
</section>
|
||||
Reference in New Issue
Block a user