Skip to content

Instantly share code, notes, and snippets.

@albertromkes

albertromkes/gist:5189838

Last active Dec 15, 2015
Embed
What would you like to do?
public class ArticleBuilder : BuilderBase
{
private ComponentPresentation TridionComponentPresentation { get; set; }
public ArticleBuilder(ComponentPresentation componentPresentation)
{
TridionComponentPresentation = componentPresentation;
}
public Article Build()
{
var tridionComponent = TridionComponentPresentation.Component;
var articleViewModel = new Article
{
Title = tridionComponent.Fields["title"].Value,
Summary = ResolveRichText(tridionComponent.Fields["short_intro"].Value),
RelatedLinks = tridionComponent.Fields["related_links"].Values.ToList()
//Etc
}
//Work magic for XPM
MakeInlineEditable(articleViewModel);
return articleViewModel;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.