From 5e53b4dd46ac81bad6aaff75814cc3a10fb0a751 Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Mon, 13 Sep 2010 14:48:22 -0700 Subject: [PATCH] Getting display in order for the (routable-specified) home page --HG-- branch : theming --- .../Core/Contents/Views/Items/Content-HomePage.cshtml | 11 +++++++++++ src/Orchard.Web/Core/HomePage/Views/HomePage.cshtml | 11 ----------- src/Orchard.Web/Core/Orchard.Core.csproj | 4 ++-- .../Routable/Services/RoutableHomePageProvider.cs | 7 +++---- src/Orchard.Web/Orchard.Web.csproj | 1 - .../Themes/Contoso/Views/HomePage/Home/Index.cshtml | 5 ----- 6 files changed, 16 insertions(+), 23 deletions(-) create mode 100644 src/Orchard.Web/Core/Contents/Views/Items/Content-HomePage.cshtml delete mode 100644 src/Orchard.Web/Core/HomePage/Views/HomePage.cshtml delete mode 100644 src/Orchard.Web/Themes/Contoso/Views/HomePage/Home/Index.cshtml diff --git a/src/Orchard.Web/Core/Contents/Views/Items/Content-HomePage.cshtml b/src/Orchard.Web/Core/Contents/Views/Items/Content-HomePage.cshtml new file mode 100644 index 000000000..29372907c --- /dev/null +++ b/src/Orchard.Web/Core/Contents/Views/Items/Content-HomePage.cshtml @@ -0,0 +1,11 @@ +@{ + //home page content - should fall back to items/content so this template is optional (e.g. in a theme) +} +
+
+@Display(Model.Header) +
+
+@Display(Model.primary) +
+
\ No newline at end of file diff --git a/src/Orchard.Web/Core/HomePage/Views/HomePage.cshtml b/src/Orchard.Web/Core/HomePage/Views/HomePage.cshtml deleted file mode 100644 index 0357b347d..000000000 --- a/src/Orchard.Web/Core/HomePage/Views/HomePage.cshtml +++ /dev/null @@ -1,11 +0,0 @@ -@model dynamic -
-

HomePage shape template

-

I am the home page

-
-
content item id
-
@Display(Model.Id)
-
the hard way to get at the raw body text
-
@Display(Model.Parts[3].Text)
-
-
\ No newline at end of file diff --git a/src/Orchard.Web/Core/Orchard.Core.csproj b/src/Orchard.Web/Core/Orchard.Core.csproj index fa4d17fbb..e458039d1 100644 --- a/src/Orchard.Web/Core/Orchard.Core.csproj +++ b/src/Orchard.Web/Core/Orchard.Core.csproj @@ -297,6 +297,7 @@ + @@ -335,6 +336,7 @@ + @@ -395,14 +397,12 @@ - - diff --git a/src/Orchard.Web/Core/Routable/Services/RoutableHomePageProvider.cs b/src/Orchard.Web/Core/Routable/Services/RoutableHomePageProvider.cs index ac0437f0a..06a5d79fa 100644 --- a/src/Orchard.Web/Core/Routable/Services/RoutableHomePageProvider.cs +++ b/src/Orchard.Web/Core/Routable/Services/RoutableHomePageProvider.cs @@ -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()) 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(Shape.HomePage(model)) + ViewName = "Display", + ViewData = new ViewDataDictionary(model) }; } } diff --git a/src/Orchard.Web/Orchard.Web.csproj b/src/Orchard.Web/Orchard.Web.csproj index cae3f82bd..16e24d4b3 100644 --- a/src/Orchard.Web/Orchard.Web.csproj +++ b/src/Orchard.Web/Orchard.Web.csproj @@ -143,7 +143,6 @@ - diff --git a/src/Orchard.Web/Themes/Contoso/Views/HomePage/Home/Index.cshtml b/src/Orchard.Web/Themes/Contoso/Views/HomePage/Home/Index.cshtml deleted file mode 100644 index 7b70bbd12..000000000 --- a/src/Orchard.Web/Themes/Contoso/Views/HomePage/Home/Index.cshtml +++ /dev/null @@ -1,5 +0,0 @@ -@model dynamic -
-

HomePage action template

-@Display(Model) -
\ No newline at end of file