Bitrix Site Manager

Component template look-up

To search for an appropriate component template, the system user the following search order.

  1. In /bitrix/templates/current site template/components/. First, the system checks the subfolder /[component_namespace]/[component_name]/ for a file or folder with the template name. If not found, the system searches for file template_name.ext, enumerating all installed templating engines on ext.
  2. If not found, the folder /bitrix/templates/.default/components/ is searched using the same algorithm as in step 1.
  3. If not found, the system searches all system templates.

If the template name is not specified, the .default template is used.

If the required template is specified as a folder name, the system searches for file template.ext for simple components, and page_name.ext - for composite components. The default ext is "php"; if no file with this extension is found, the system enumerates all installed templating engines on ext.

For example: the component bitrix:catalog.list is to be displayed using the table template. Assume that the Smarty template engine is available on the server (*.tpl). First the system will check /bitrix/templates/current site template/components/bitrix/catalog.list/ for fiel or folder named table. If no such found, the system will search the specified folder for files table.php or table.tpl. If nothing appeared to be found again, the system will check folders /bitrix/templates/.default/components/bitrix/catalog.list/ and /bitrix/components/bitrix/catalog.list/templates/.

If the component folder is found, the system will first search for template.php, and, if template.php was not found, template.tpl. If the template is specified as "table/template.php", the file matches.

if a simple component is called as a part of a composite component, a template of a simple component is first looked up in the composite component folder, and then, if not found, in own templates.