Skip to content

Instantly share code, notes, and snippets.

@rsleggett
Forked from anonymous/ComponentView.cshtml
Last active December 10, 2015 22:18
Show Gist options
  • Save rsleggett/4501279 to your computer and use it in GitHub Desktop.
Save rsleggett/4501279 to your computer and use it in GitHub Desktop.
UI2012 samples for DD4T
@using DD4T.Mvc.Html
@model DD4T.ContentModel.IComponentPresentation
<div>
@Html.SiteEditComponentPresentation(Model)
<h1>@Html.SiteEditField(Model, Model.Component.Fields["title"])@Model.Component.Fields["title"].Value</h1>
</div>
<!-- _Layout.cshtml -->
<html>
<head></head>
<body>
<!-- Rest of code -->
@RenderSection("SiteEditSettings", false)
<!--SITE_EDIT_INIT-->
</body>
</html>
@using DD4T.Mvc.Html
@model DD4T.ContentModel.IPage
@{
Layout = "~/Shared/_Layout.cshtml";
}
<!-- Code -->
@Html.RenderComponentPresentations()
@section SiteEditSettings {
@Html.SiteEditPage(Model)
}
?xml version="1.0" encoding="utf-8"?>
<siteEdit enabled="true" style="SiteEdit2012" tridionHostUrl="http://your-tridion/">
<contextPublications>
<contextPublication id="9" componentPublication="5" pagePublication="9" publishPublication="9" />
</contextPublications>
</siteEdit>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment