如何更改Orchard中的默认html标记呈现?

时间:2015-07-09 10:06:07

标签: html content-management-system themes orchardcms

我启用了主题,Orchard像这样呈现页面

<!DOCTYPE html> 
<html lang="de-DE" class="static dir-ltr dennree-tuesdaymail" dir="ltr"> 
<head> 
  <meta ...

但是我需要它像这样呈现

<!DOCTYPE html>
<!--[if IE 8]> <html lang="de" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="de" class="ie9"> <![endif]-->
<!--[if !IE]><!-->
<html lang="de" xml:lang="de">
<!--<![endif]-->
<head>
  <meta ...

我没有找到任何方法来调整Orchard主题的Layout.cshtml中的html标记呈现。

有任何建议如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

您必须在主题中创建Document.cshtml

@using Orchard.Mvc.Html;
@using Orchard.UI.Resources;
@{
    RegisterLink(new LinkEntry {Type = "image/x-icon", Rel = "shortcut icon", Href = Url.Content("~/modules/orchard.themes/Content/orchard.ico")});
    Script.Include("html5.js").UseCondition("lt IE 9").AtHead();

    string title = Convert.ToString(Model.Title);
    string siteName = Convert.ToString(WorkContext.CurrentSite.SiteName);
}
<!DOCTYPE html> 
<html lang="@WorkContext.CurrentCulture" class="static @Html.ClassForPage()"> 
<head> 
    <meta charset="utf-8" />
    <title>@Html.Title(title, siteName)</title> 
    @Display(Model.Head)
    <script>        (function (d) { d.className = "dyn" + d.className.substring(6, d.className.length); })(document.documentElement);</script> 
</head> 
<body>
@* Layout (template) is in the Body zone @ the default position (nothing, zero, zilch) *@
@Display(Model.Body)
@Display(Model.Tail)
</body>
</html>