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
@foreach (var cp in Model.ComponentPresentations.Where(cp => cp.RenderData.View == "ContentBlock")) | |
{ | |
@Html.Render(cp) | |
} |
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
[ComponentPresentations] | |
public List<IRenderableViewModel> ComponentPresentations { get; set; } |
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 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 *@ |
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
</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> |
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
<!-- 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" --> |
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
<!-- 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" --> |
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
// componentUri is a TcmUri representing the id of the binary component that you want to publish | |
// This snippet shows how you can add the item id to the filename. | |
var component = (Component)engine.GetObject(componentUri); | |
var filename = component.BinaryContent.Filename | |
extension = Path.GetExtension(filename); | |
filename = Path.GetFileNameWithoutExtension(filename); | |
filename = String.Concat(filename, "_", componentUri.ItemId.ToString(), extension); | |
engine.AddBinary(component.Id, null, null, component.BinaryContent.GetByteArray(), filename); |
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
[TcmTemplateTitle("SuffixBinariesWithId")] | |
public class SuffixBinariesWithId: ITemplate | |
{ | |
public void Transform(Engine engine, Package package) | |
{ | |
string paramMimeTypesToMatch = package.GetValue("mimeTypesToMatch"); | |
// match all image types by default | |
string mimeTypesToMatch = "image/*"; | |
if (!string.IsNullOrWhiteSpace(paramMimeTypesToMatch)) | |
{ |
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
# Depends on Tridion Powershell Modules (http://code.google.com/p/tridion-powershell-modules/) | |
function createPublication { | |
Param( | |
[parameter(Mandatory=$true)] | |
[ValidateNotNullOrEmpty()] | |
$core, | |
[parameter(Mandatory=$true)] | |
[ValidateNotNullOrEmpty()] | |
[string]$title, |
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
# Depends on PowerShell Reflection module (http://poshcode.org/search/Reflection) | |
# Depends on Tridion Powershell Modules (http://code.google.com/p/tridion-powershell-modules/) | |
$autoLocalize = $true | |
import-module Tridion-CoreService | |
$core = Get-TridionCoreServiceClient | |
import-module Reflection | |
import-namespace Tridion.ContentManager.CoreService.Client |