Created
June 1, 2015 11:49
-
-
Save mortenbock/19a5686939d61240ecc3 to your computer and use it in GitHub Desktop.
Generic Ditto take 2
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 Our.Umbraco.Ditto; | |
using Umbraco.Core; | |
using Umbraco.Core.Models.PublishedContent; | |
namespace MappingDemo.Custom.Mvc | |
{ | |
public class ConfigFactory : ApplicationEventHandler | |
{ | |
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) | |
{ | |
PublishedContentModelFactoryResolver.Current.SetFactory<PublishedContentModel>(); | |
} | |
} | |
} |
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
@inherits UmbracoTemplatePage<MappingDemo.Custom.Models.HomePage> | |
@{ | |
Layout = "Master.cshtml"; | |
} | |
<h1 style="color: red">@Model.Content.Name</h1> | |
<p>@Model.Content.SiteTitle</p> | |
@Model.Content.GetGridHtml("content", "fanoe") |
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 Umbraco.Core.Models; | |
using Umbraco.Core.Models.PublishedContent; | |
namespace MappingDemo.Custom.Models | |
{ | |
[PublishedContentModel("Home")] | |
public class HomePage : PublishedContentModel | |
{ | |
public string SiteTitle { get; set; } | |
public HomePage(IPublishedContent content) : base(content) | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment