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:facet category='tcm:1-3-4' /> 

        <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>

Attributes

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

AttributeDescription
idA unique String value identifying a query.
publicationThe Web site Publication TCM URI from which to retrieve content for promotions (used only with the tcdl:facet tag).
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 Web page 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 Web site.
  • 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 Web page a user is viewing. For information on defining these promotions, see Defining Page template triggers.

redirectBoolean to redirect certain search queries to specific pages.

Set to true (the default) to automatically redirect the user based on redirects that you have defined in the Business Manager. Set to false to manage the redirects manually.