Skip to content

Instantly share code, notes, and snippets.

@katstojanovski
katstojanovski / Article.cshtml
Created May 25, 2016 07:40
Article CT View
@model SimpleDD4T2Application.Models.Component.Article
<!-- Article CT View -->
<div class="article">
<h2>@Model.Heading</h2>
</div>
<!-- End Article CT View -->
@model SimpleDD4T2Application.Models.Page.Generic
<!DOCTYPE html>
<html>
<head>
<title>@Model.PageTitle</title>
</head>
<body>
<!-- Page Metadata Keywords -->
<div class="keywords">
@foreach (var keyword in Model.Keywords)
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<!-- Page Metadata Keywords -->
<div class="keywords">
<span class="keyword">test</span>
<span class="keyword">dd4t</span>
@katstojanovski
katstojanovski / web.config
Created May 24, 2016 14:14
Component Controller Default Configuration
<add key="DD4T.ComponentPresentationController" value="Component" />
<add key="DD4T.ComponentPresentationAction" value="ComponentModel" />
@katstojanovski
katstojanovski / Generic.cs
Last active May 24, 2016 13:59
Page ViewModel
[PageViewModel(TemplateTitle = "Generic")]
public class Generic : ViewModelBase
{
[PageTitle]
public string PageTitle { get; set; }
[TextField(IsMetadata = true)]
public List<string> Keywords { get; set; }
[ComponentPresentations]
@katstojanovski
katstojanovski / Article.cs
Last active May 24, 2016 13:58
Article ViewModel
[ContentModel("article", true)]
public class Article : ViewModelBase, IRenderableViewModel
{
[TextField]
public string Heading { get; set; }
[RenderData]
public IRenderData RenderData { get; set; }
}