Conditional Content

Using Sailthru's powerful template syntax combined with Horizon interest data, you can display pieces of content conditionally.

Example

Let's suppose you are a fashion retailer. You have images of a dress in three colors: black, green, and purple polka dot. You have been using Horizon to track the colors that customers are looking at on your website, so Sailthru has interest data on colors.

{select}
{case horizon_interest('black,dark')}
<img src="http://example.com/dress-image-black.jpg" />
{/case}
{case horizon_interest('green')}
<img src="http://example.com/dress-image-green.jpg" />
{/case}
{case horizon_interest('purple,polka_dot,pattern')}
<img src="http://example.com/dress-image-polkadot.jpg" />
{/case}
{/select}

The {select} control structure will compare the horizon_interest score for the customer for each of the tags and pick the piece of content with the highest score. If there is no relevant interest data about the customer, the first item (the black dress) will be selected, so the top item should be the "default" or generic item.

 
/var/www/docs.sailthru.com/htdocs/data/pages/conditional-content.txt · Last modified: 2010/08/03 11:24 by Neil Capel
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki