Skip to content

Instantly share code, notes, and snippets.

@herskinduk
Last active April 25, 2016 22:12
Show Gist options
  • Save herskinduk/dead1a89ea8486a6fa15 to your computer and use it in GitHub Desktop.
Save herskinduk/dead1a89ea8486a6fa15 to your computer and use it in GitHub Desktop.
Sitecore MVC Layout views
@using Sitecore.Mvc
@using Sitecore.Mvc.Analytics.Extensions
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<title>@Html.Sitecore().Field("title", new { DisableWebEdit = true })</title>
@Html.Sitecore().VisitorIdentification()
<!-- output meta tag based on renderings in placeholder here ... -->
</head>
<body>
<h1>@Html.Sitecore().Field("title")</h1>
<div>
@Html.Sitecore().Placeholder("main")
</div>
</body>
</html>
@using Sitecore.Mvc
@{
Layout = "MVC2_Layout.cshtml";
}
<h1>@Html.Sitecore().Field("title")</h1>
<div>
@Html.Sitecore().Placeholder("main")
</div>
@using Sitecore.Mvc
@using Sitecore.Mvc.Analytics.Extensions
<!DOCTYPE html>
<html>
<head>
<title>@Html.Sitecore().Field("title", new { DisableWebEdit = true })</title>
@Html.Sitecore().VisitorIdentification()
<!-- output meta tag based on renderings in placeholder here ... -->
</head>
<body>
@RenderBody()
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment