Skip to content

Instantly share code, notes, and snippets.

Avatar

Albert Romkes albertromkes

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am albertromkes on github.
  • I am albertromkes (https://keybase.io/albertromkes) on keybase.
  • I have a public key whose fingerprint is B6CD DF86 4CA5 EAF8 DD71 FB4C EF67 B197 F7DC F0FD

To claim this, I am signing this object:

View gist:8654418
@*Start of Component Presentation in View*@
@XPM.StartInlineEditingZone()
@* or for a 'submodel' (Component Presentation in a Component Presentation) *@
@XPM.StartInlineEditingZone(Model.Teaser)
@*Write out MarkUp and value*@
<h2>@XPM.Editable(m => m.Title)</h2>
View gist:8652149
var model = new ArticleModel();
new XpmActions().MakeInlineEditable<ArticleModel>(model, tridionComponentPresentation);
return model;
View gist:8652069
[InlineEditable]
public class ArticleModel
{
[InlineEditableField(FieldName="title")]
public string Title { get; set; }
[InlineEditableField(FieldName="complink_to_article")]
public HyperLink LinkToFullArticle { get; set; }
[InlineEditableField(FieldName="related_articles")]
View gist:8518407
Tridion.Configuration.ConfigurationSections tcmConfigSections = (Tridion.Configuration.ConfigurationSections)ConfigurationManager.GetSection(Tridion.Configuration.ConfigurationSections.SectionName);
var tcmSectionElem = tcmConfigSections.Sections.Cast<Tridion.Configuration.SectionElement>().FirstOrDefault(s => !string.IsNullOrEmpty(s.FilePath) && s.FilePath.EndsWith("tridion.contentmanager.config", StringComparison.InvariantCultureIgnoreCase));
if(tcmSectionElem != null)
{
var tcmConfigFilePath = tcmSectionElem.FilePath;
//load Tridion.ContentManager.config
ExeConfigurationFileMap map = new ExeConfigurationFileMap { ExeConfigFilename = tcmConfigFilePath };
var config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
var myCustomResolverSettings = ((AppSettingsSection)config.GetSection("My.Tridion.CustomResolving")).Settings;
var schemaTitles = myCustomResolverSettings["schemaTitles"].Value.ToString();
View gist:5190159
@model ArticleViewModel
@foreach(var relatedLink in Model.RelatedLinks)
{
<div class="cd-list">
<a class="cd-link-ext" title="@relatedLink.Title" href="@relatedLink.Url" target="_blank">
@Html.RenderImage(relatedLink)
</a>
</div>
}
View gist:5190145
@model DD4T.ContentModel.IComponent
@foreach (IFieldSet fieldset in Model.Fields["RelatedLinks"].EmbeddedValues)
{
<div class="cd-list">@if (fieldset.ContainsKey("Link") || fieldset.ContainsKey("ExternalLink"))
{
<a class="cd-link-ext" title="" href="@fieldset[" target="_blank">
@Html.SiteEditField(Model, fieldset["Image"])
@fieldset["Image"].GetImage("img")
</a>
View gist:5190070
<div>
@XPM.MarkUp(m => m.ImageUrl)
<img src="@Model.ImageUrl" />
</div>
View gist:5190027
@model ArticleViewModel
<div class="middleContent">
@XPM.StartInlineEditingZone()
<h2>@XPM.Editable(m => m.Title)</h2>
<div class="intro">
@XPM.Editable(m => m.Summary)
</div>
View gist:5189838
public class ArticleBuilder : BuilderBase
{
private ComponentPresentation TridionComponentPresentation { get; set; }
public ArticleBuilder(ComponentPresentation componentPresentation)
{
TridionComponentPresentation = componentPresentation;
}
public Article Build()