1. Component library

QueryDataSource

Version:

You use the QueryDataSource component to retrieve Sitecore items, using a Sitecore Query or a Sitecore Fast Query.

Properties

NameDescriptionDefault
Appearance
FormattingSpecify a formatting token:

  • $convert_date_to_friendly_format: convert internal date format to localized format
  • $send_localized_dates: send localized versions of all dates
  • $convert_id_to_display_name: convert item IDs to the display names of the items


You can enter multiple formats as a pipe-separated (“|”) list.
Data
DatabaseSpecify the database that Sitecore queries:

  • The exact name of a database, for example “core”, or “master”.
  • $context_database: context database.
  • $context_contentdatabase: content database.
The context database
FieldsYou can provide a pipe-separated (“|”) list of field names or IDs that Sitecore retrieves. If you enter an asterix, “*”, Sitecore retrieves all fields. Retrieve as few fields as possible to improve performance.If you do not enter anything, all fields are retrieved.
IsBusyThis read-only property is True when the QueryDataSource component is busy retrieving items.
ItemsContains the retrieved items. You normally bind to this property from a control that can display items, for example, the ListControl control.
LanguageSpecify the language version of the items you want to search in:

  • Empty: search in all languages.
  • $context_language: search in current language from the CMS
  • Exact language: for example: "ja-jp" or "en-us"
All languages
QuerySpecify a Sitecore Query or a Sitecore Fast Query.
Paging
PageIndexThe component does not use this property.
PageSizeThe component does not use this property.

Configuration

You can create a configuration item for a QueryDataSource component by creating an item based on the QueryDataSource Parameters template.

The configuration item has these specific fields:

  • Query
  • IsBusy
  • Items

It inherits these fields:

  • Database
  • Fields
  • PageSize
  • PageIndex
  • Language
  • Behaviors
  • Id
If you have suggestions for improving this article, let us know!