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
@model ArticleViewModel | |
@{ | |
int counter = 0; | |
} | |
@foreach(var relatedLink in Model.RelatedLinks) | |
{ | |
<div class="cd-list"> | |
@Html.SiteEditField(Model.TridionComponent.Fields["hyperlinks"][counter]) | |
<a href="@relatedLink.Url" title="@relatedLink.Title" class="cd-link-ext" target="_blank"> | |
@Html.SiteEditField(Model.TridionComponent.Fields["Image"][0]) |
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
@model ArticleViewModel | |
@foreach(var relatedLink in Model.RelatedLinks) | |
{ | |
<div class="cd-list"> | |
@relatedLink.XPMMarkUp | |
<a href="@relatedLink.Url" title="@relatedLink.Title" class="cd-link-ext" target="_blank"> | |
@relatedLink.Image.XPMMarkUp | |
@Html.RenderImage(relatedLink) | |
</a> |
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
[InlineEditable] | |
public class Article : IArticle | |
{ | |
[InlineEditableField(FieldName="title")] | |
public string Title {get;set;} | |
[InlineEditableField(FieldName="short_intro")] | |
public string Summary {get;set;} | |
private IList<string> _relatedLinks = new List<string>(); |
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
public class ArticleBuilder : BuilderBase | |
{ | |
private ComponentPresentation TridionComponentPresentation { get; set; } | |
public ArticleBuilder(ComponentPresentation componentPresentation) | |
{ | |
TridionComponentPresentation = componentPresentation; | |
} | |
public Article Build() |
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
@model ArticleViewModel | |
<div class="middleContent"> | |
@XPM.StartInlineEditingZone() | |
<h2>@XPM.Editable(m => m.Title)</h2> | |
<div class="intro"> | |
@XPM.Editable(m => m.Summary) | |
</div> |
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
<div> | |
@XPM.MarkUp(m => m.ImageUrl) | |
<img src="@Model.ImageUrl" /> | |
</div> |
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
@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> |
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
@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> | |
} |
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
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(); |
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
[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")] |
OlderNewer