To search for an appropriate component template, the system user the following search order.
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.
|© 2001-2009, Bitrix Inc.||Bitrix Site Manager|