Documentation Center

tcdl:query

The <tcdl:query> tag defines a query for retrieving content that is displayed in a Page Region.

Syntax

<tcdl:region id="Sidebar" type="SmartTarget"> 
    <tcdl:query publication='tcm:0-1-1'> 
        <tcdl:promotions region='Sidebar' maxItems='5'> 
            <tcdl:itemTemplate> 
                 <tcdl:promotionalItems> 
                      <tcdl:itemTemplate>                                                                                          
                            <tcdl:ComponentPresentation ComponentURI='##componentUri##' TemplateURI='##templateUri##' Type='Dynamic'/> 
                      </tcdl:itemTemplate> 
                 </tcdl:promotionalItems> 
            </tcdl:itemTemplate> 
            <tcdl:fallbackContent>...
            </tcdl:fallbackContent> 
        </tcdl:promotions> 
    </tcdl:query> 
</tcdl:region>

Parent element

<tcdl:region>

Child elements

  • <tcdl:search>
  • <tcdl:attribute>
  • <tcdl:items>
  • <tcdl:promotions>

Attributes

The <tcdl:query> tag has the following attributes:

AttributeDescription
idA unique String value identifying a query.
publicationThe website Publication TCM URI from which to retrieve content for promotions

For example, if you are on a German website, you can set the attribute to the TCM URI of the relevant German website's Publication. The result will be that only the Promotions that specify this Publication get returned and all of the returned items will be the localized German versions.

allowDuplicates

Boolean to display content (promotional items) already displayed in preceding regions on this Page or not:

  • true—promotions already in the output of preceding regions on this Page may also be displayed in this page region.
  • false—promotions already in the output of preceding regions will be filtered out of the results.
timeout The length of time, expressed in milliseconds, to wait for the result of the query to be received before fallback content is displayed in an Experience Optimization region. If specified, the setting overrides the default timeout in the smarttarget_conf.xml file.
viewThe type of webpage the promotions apply to.
  • lister—a page which displays a list of articles (content items); each item shows a summary of the content with a link to the entire article.
  • detail—a page which displays the entire article (content item).
  • search—a page which displays a summary of articles (content items) that match the search term entered with a link to the entire article.
  • home—a page which displays the Home page of the website.
  • summary—a page which displays a summary of the article (content item) with a link to the entire article.
  • compare—a page which displays details of multiple content items for comparison.

The view attribute triggers promotions depending on the type of webpage a user is viewing.