Skip to content

Instantly share code, notes, and snippets.

View DominicCronin's full-sized avatar
💭
Still Upskilling on Azure DevOps.

Dominic Cronin DominicCronin

💭
Still Upskilling on Azure DevOps.
View GitHub Profile
@DominicCronin
DominicCronin / gist:6776134
Created October 1, 2013 09:48
Example of Tridion Razor templating
<div class=”@Component.Fields.NewsStyle”>
<img src=”@Fields.HeaderImage.ID” alt=”@Fields.HeaderImage.AltText” />
@* Note that Fields is just a shortcut to Component.Fields *@
<h2>@Fields.Header</h2>
<h5>@Fields.NewsDate.ToString(“dd/MM/yy hh:mm”)</h5>
<div class=”body-text”>
@Fields.BodyText
</div>
<ul>
@* Now we'll loop over a ComponentLink field and grab the component title and a field *@
@DominicCronin
DominicCronin / gist:6776110
Last active December 24, 2015 09:19
Example of Tridion XSLT templating
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$content/linkitem:link_component">
<xsl:apply-templates select="$content/linkitem:link_component">
<xsl:with-param name="linktitle" select="$link_title"/>
<xsl:with-param name="linktext" select="$linktext"/>
<xsl:with-param name="linkclass" select="$linkclass"/>
</xsl:apply-templates>
@DominicCronin
DominicCronin / gist:6775961
Created October 1, 2013 09:27
Example of Tridion Dreamweaver templating
<!-- TemplateBeginRepeat name="Component.Fields" -->
@@Field.Name@@
<!-- TemplateBeginRepeat name="Field.Values" -->
<!-- TemplateBeginIf cond="Field.ContentType = 'text/plain'" -->
@@RenderComponentField(FieldPath, TemplateRepeatIndex)@@
<!-- TemplateEndIf -->
<!-- TemplateBeginIf cond="Field.ContentType = 'tridion/field'" -->
<!-- TemplateBeginRepeat name="Field.Fields" -->
@@Field.Name@@
<!-- TemplateBeginRepeat name="Field.Values" -->
@DominicCronin
DominicCronin / gist:6775796
Created October 1, 2013 09:09
Example of Tridion dreamweaver templating
<!-- TemplateBeginRepeat name="Component.Fields" -->
@@Field.Name@@
<!-- TemplateBeginRepeat name="Field.Values" -->
<!-- TemplateBeginIf cond="Field.ContentType = 'text/plain'" -->
@@RenderComponentField(FieldPath, TemplateRepeatIndex)@@
<!-- TemplateEndIf -->
<!-- TemplateBeginIf cond="Field.ContentType = 'tridion/field'" -->
<!-- TemplateBeginRepeat name="Field.Fields" -->
@@Field.Name@@
<!-- TemplateBeginRepeat name="Field.Values" -->