Skip to content

Instantly share code, notes, and snippets.

View DWT repeast and if after 2011 SP1 HR1.dwt
<!-- TemplateBeginRepeat name="Component.Fields.repeatField" -->
<!-- TemplateBeginIf cond = "TemplateRepeatIndex == 0 " -->
<ul>
<!-- TemplateEndIf -->
<li>@@Field@@</li>
<!-- TemplateBeginIf cond = "TemplateRepeatIndex) == @@CollectionLength("repeatField")@@-1" -->
</ul>
<!-- TemplateEndIf -->
<!-- TemplateEndRepeat -->
@jhorsman
jhorsman / SmartTargetTags-2011.aspx
Created Apr 10, 2014
SmartTarget tags example for SmartTarget 2011
View SmartTargetTags-2011.aspx
<!-- Start Promotion Region: {"RegionID": "HomepageBanners" } -->
<smarttarget:Query View="home" Publication="tcm:0-69-1" runat="server" SiteEditTagName="span">
<smarttarget:Facet Category="tcm:69-707-4" runat="server"></smarttarget:Facet>
<smarttarget:Promotions MaxItems="1" Region="HomepageBanners" runat="server">
<ItemTemplate>
<smarttarget:PromotionalItems runat="server">
<ItemTemplate>
<span>
<!-- Start Promotion: { "PromotionID": "<%# Eval("promotionID") %>", "RegionID" : "<%# Eval("region") %>"} -->
@jhorsman
jhorsman / promotions.jsp
Created May 2, 2014
SDL SmartTarget promotions on JSP
View promotions.jsp
<smarttarget:query view="home" publication="tcm:0-71-1">
<smarttarget:facet category="tcm:69-707-4"></smarttarget:facet>
<smarttarget:promotions maxItems="3" var="promotion" region="homepagepromotions"> <!-- HomepageBanners -->
<smarttarget:itemTemplate>
<smarttarget:promotionalItems>
<smarttarget:itemTemplate>
<tridion:ComponentPresentation pageURI="tcm:69-6212-64" componentURI="${item.componentUri}" templateURI="${item.templateUri}"/>
</smarttarget:itemTemplate>
</smarttarget:promotionalItems>
</smarttarget:itemTemplate>
@jhorsman
jhorsman / SmartTarget_tag_demo.aspx
Last active Aug 29, 2015
SDL SmartTarget tag demo of variables in the promtion query in a SDL SmartTarget enabled page. This is ASPX code. See https://gist.github.com/jhorsman/8363387 for the JSP version.
View SmartTarget_tag_demo.aspx
<%@ Page Title="SDL SmartTarget tag demo" Language="C#" %>
<%@ Register Assembly="Tridion.SmartTarget" Namespace="Tridion.SmartTarget.Web.UI" TagPrefix="smarttarget" %>
<%@ Import Namespace="System.Web" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>SmartTarget tag demo</title>
</head>
<body>
View Install to Global Assembly cache
PowerShell.exe -ExecutionPolicy RemoteSigned -Command "& {.\Add-AssemblyToGlobalAssemblyCache.ps1 -AssemblyName C:\Temp\MyWorkflow.dll }"
@jhorsman
jhorsman / start-Fredhopper.bat
Created May 13, 2014
Start SDL Fredhopper. A handy (Windows only) development tool when using SDL SmartTarget 2014. On a production server the Fredhopper processes would be started by a Scheduled Task on start of the server. Run start-Fredhopper.bat to get things going.
View start-Fredhopper.bat
@echo off
start start-deployment-agent.bat
echo Launched deployment agent in separate window
echo.
echo Pausing before starting the instance
timeout 60
echo.
start start-instance.bat
@jhorsman
jhorsman / .gitignore
Created May 13, 2014
Ignore all Visual Studio stuff
View .gitignore
*.suo
*.user
bin/
_ReSharper.*/
obj/
@jhorsman
jhorsman / promotion.aspx
Created May 14, 2014
SDL Tridion .NET controls for SDL SmartTarget 2014 promotion
View promotion.aspx
<div>
<!-- Start Promotion Region: {"RegionID": "HomepagePromotions" } -->
<smarttarget:Query AllowDuplicates="false" Publication="tcm:0-6-1" runat="server" SiteEditTagName="div">
<smarttarget:Promotions MaxItems="3" Region="HomepagePromotions" runat="server">
<ItemTemplate>
<smarttarget:PromotionalItems runat="server">
<ItemTemplate>
<div>
<!-- Start Promotion: { "PromotionID": "<%# Eval("promotionID") %>", "RegionID" : "<%# Eval("region") %>"} -->
<tridion:ComponentPresentation runat="server"
@jhorsman
jhorsman / start-Fredhopper.bat
Created Jul 18, 2014
Start Fredhopper processes. For a development box, usually this would run as a scheduled task. Just run start-Fredhopper.bat
View start-Fredhopper.bat
@echo off
start start-deployment-agent.bat
echo Launched deployment agent in separate window
echo.
echo Pausing before starting the instance
timeout 30
echo.
echo Starting instance...
@jhorsman
jhorsman / SmartTarget-controls-2014.aspx
Last active Aug 29, 2015
SmartTarget ASP.NET controls example for SmartTarget 2014
View SmartTarget-controls-2014.aspx
<smarttarget:Query Publication="tcm:0-69-1" runat="server" SiteEditTagName="span">
<smarttarget:Promotions MaxItems="3" Region="Homepage Promotions" runat="server">
<ItemTemplate>
<smarttarget:PromotionalItems runat="server">
<ItemTemplate>
<span>
<!-- Start Promotion: { "PromotionID": "<%# Eval("promotionID") %>", "RegionID" : "<%# Eval("region") %>"} -->
<tridion:ComponentPresentation runat="server" PageURI="tcm:69-6212-64" ComponentURI="<%# Eval(&quot;ComponentUri&quot;) %>" TemplateURI="<%# Eval(&quot;TemplateUri&quot;) %>"/>
<!-- End Promotion -->
</span>