Skip to content

Instantly share code, notes, and snippets.

<!-- 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 April 10, 2014 15:16
SmartTarget tags example for SmartTarget 2011
<!-- 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 06:59
SDL SmartTarget promotions on 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 August 29, 2015 14:01
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.
<%@ 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>
PowerShell.exe -ExecutionPolicy RemoteSigned -Command "& {.\Add-AssemblyToGlobalAssemblyCache.ps1 -AssemblyName C:\Temp\MyWorkflow.dll }"
@jhorsman
jhorsman / start-Fredhopper.bat
Created May 13, 2014 06:55
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.
@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 14:52
Ignore all Visual Studio stuff
*.suo
*.user
bin/
_ReSharper.*/
obj/
@jhorsman
jhorsman / promotion.aspx
Created May 14, 2014 18:04
SDL Tridion .NET controls for SDL SmartTarget 2014 promotion
<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 July 18, 2014 07:52
Start Fredhopper processes. For a development box, usually this would run as a scheduled task. Just run 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 August 29, 2015 14:05
SmartTarget ASP.NET controls example for SmartTarget 2014
<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>