Adding something for the page title to the core document template (and widget shape template)*

*exploration work

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-10-13 01:02:54 -07:00
parent 8e2f7e974a
commit cfa1601676
4 changed files with 11 additions and 4 deletions

View File

@@ -8,7 +8,6 @@ using System.Web.Mvc;
using System.Web.Mvc.Html;
using Orchard.DisplayManagement;
using Orchard.DisplayManagement.Descriptors;
using Orchard.DisplayManagement.Implementation;
using Orchard.Settings;
using Orchard.UI;
using Orchard.UI.Resources;

View File

@@ -4,12 +4,18 @@
RegisterLink(new LinkEntry {Type = "image/x-icon", Rel = "shortcut icon", Href = Url.Content("~/modules/orchard.themes/Content/orchard.ico")});
//todo: (heskew) get conditions (as in conditional comments) hooked up for script tags too
Script.Include("html5.js").AtLocation(ResourceLocation.Head);
//a bit opinionated - only the site name on the homepage
var title = (Request.Path != Request.ApplicationPath && !string.IsNullOrWhiteSpace((string)Model.Title)
? Model.Title + WorkContext.CurrentSite.PageTitleSeparator
: "") +
WorkContext.CurrentSite.SiteName;
}
<!DOCTYPE html>
<html lang="en" class="static @Html.ClassForPage()">
<head>
<meta charset="utf-8" />
<title>@Model.Title</title>
<title>@title</title>
@Display(Model.Head)
<script>(function(d){d.className="dyn"+d.className.substring(6,d.className.length);})(document.documentElement);</script>
</head>

View File

@@ -1,4 +1,7 @@
@if(Model.Content != null) {
@{
Layout.Title = Model.Title;
}
@if(Model.Content != null) {
<article>
@if(Model.Header != null) {
<header>

View File

@@ -11,7 +11,6 @@ using Orchard.Mvc.Spooling;
using Orchard.Security;
using Orchard.Security.Permissions;
using Orchard.UI.Resources;
using TagBuilder = System.Web.Mvc.TagBuilder;
namespace Orchard.Mvc.ViewEngines.Razor {