Implementing SmartTarget on a development VM, and I've discovered that there's a surprising lack of information about how to use SmartTarget inside of DD4T. I understand that the Razor engine is almost a completely separate entity from the standard ASP.NET WebForms, so the use of custom controls (e.g., <smarttarget:query runat="server"...
) isn't supported.
I'm thinking that using REL in my views might work, as that's a runtime Java operation separate from the standard tag handling that occurs server-side.
Is there an established best practice for using SmartTarget within DD4T, and if not what have you used to render promotions in regions? And why?
This is partly an academic exercise, partly practice. The lack of information on the topic suggests that there is no wrong answer (unless you tell me it can't be done; at which I say, "Phooey!").
I was thinking that plain REL would work:
<tcdl:query id='query2' timeout='2000' publication='tcm:0-31-1' allowDuplicates='true'>
<tcdl:promotions region='Sidebar' maxItems='10' var='promos'>
<h4>Showing #{promos.size} promotions</h4>
<tcdl:itemTemplate var='promo' items='#{promos}'>
<tcdl:promotionalItems var='promoItems'>
<tcdl:itemTemplate var='promoItem' items='#{promoItems}'>
<tcdl:ComponentPresentation ComponentURI='#{promoItem.componentUri}' TemplateURI='#{promoItem.templateUri}' Type='Dynamic'/>
</tcdl:itemTemplate>
</tcdl:promotionalItems>
</tcdl:itemTemplate>
</tcdl:promotions>
</tcdl:query>
Thank you in advance for your suggestions and answers!