Last active
April 29, 2016 08:34
-
-
Save herskinduk/f04e9354922fa1068726 to your computer and use it in GitHub Desktop.
Sitecore MVC inside-out layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Sitecore.Mvc.Presentation | |
@using Sitecore.Mvc | |
@model RenderingModel | |
@{ | |
Layout = null; | |
Sitecore.Context.Items["twitter:title"] = Model.Item["title"] | |
Sitecore.Context.Items["twitter:description"] = Model.Item["description"] | |
} | |
<h1>@Html.Sitecore().Field("title")</h1> | |
@Html.Sitecore().Field("text") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Sitecore.Mvc | |
@{ | |
Layout = "OuterLayout.cshtml"; | |
} | |
<div> | |
@Html.Sitecore().Placeholder("main") | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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() | |
@if (Sitecore.Context.Items["twitter:title"] != null && Sitecore.Context.Items["twitter:description"] != null) | |
{ | |
<meta name="twitter:card" content="summary" /> | |
<meta name="twitter:title" content="@Sitecore.Context.Items["twitter:title"]" /> | |
<meta name="twitter:description" content="@Sitecore.Context.Items["twitter:description"]" /> | |
} | |
</head> | |
<body> | |
@RenderBody() | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment