5

Per the SDL SmartTarget 2014 documentation, tcdl queries appear in regions.

<tcdl:region>
  <tcdl:query>
   <tcdl:facet />
   <tcdl:item />    
   <tcdl:search />
   <tcdl:attribute />
   <tcdl:promotions />
   <tcdl:navigation />
  <tcdl:items />                                
 </tcdl:query>
</tcdl:region>

Example:

<tcdl:region id="Sidebar" type="SmartTarget"> 
  <tcdl:query publication='tcm:0-1-1'> 
    <tcdl:facet category='tcm:1-3-4' /> 
    <tcdl:promotions region='Sidebar' maxItems='5'> 
    ...
    </tcdl:promotions> 
</tcdl:query> 

What's the (ordinal) relationship between regions and queries?

  1. Is it a 1:1 (one-to-one) relationship?
  2. If not, does each region need a query?
  3. Must a query appear within a region (i.e. can queries be added elsewhere on a page?

  4. In the example, does the Sidebar in <tcdl:promotions region='Sidebar' maxItems='5'> represent the Sidebar id in <tcdl:region id="Sidebar" type="SmartTarget">?

For SmartTarget functional requirements I think we can document region and query requirements together, but I want to be sure.

If regions always have a query, then at least functionally, a region would be:

  • Name (Id)
  • Publication
  • Allow Duplicates (Y/N)
  • Timeout (milliseconds)
  • View (not supported, but would be one of: lister, detail, search, home, summary, compare)
  • Redirect (T/F)

Plus additional SmartTarget functionality for that region (e.g. search, navigation, promotions, etc).

4

Queries are independent of regions and can appear outside of them; but the TBBs will only support adding them to regions. That's mostly because there are not many ways to programmatically determine where in the HTML to place something -- so it requires you to mark those areas with a region for easy access.

You can have multiple regions with Promotions inside a single query. In fact, it is recommended to have a single query per web page if at all possible.

Typically when using the TBBs that would mean having a "query region" on the outside (say, immediately inside the body element in the HTML) and one or more Promotion regions on the inside. A "query region" would not need to be available for Promotions, so you don't need to have them in your configuration -- they just need to be in the template output.

As for your 4th question: yes, Sidebar means the same thing in all of those cases.

  • Thanks, Peter. So in that example setup, the id for the query region only really matters for the Add SmartTarget Query TBB, right? The documentation examples happen to re-use the same id, but I could have say three (independent) regions: one for the ST query, one for say "sidebar" promotions, and another for "bottom" promotions? – Alvin Reyes Aug 26 '14 at 20:04
  • Yeah, that's exactly right. – Peter Kjaer Aug 26 '14 at 21:06
  • Good Q&A, cause this separation between region and query is not documented afaik. – Jan H Aug 29 '14 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.