Last Modified: 10.10.2012
The two types of component templates exist: system and custom:
- System templates are shipped with the standard components and stored in the templates subfolder of a component folder.
- Custom templates are those modified to deliver the required functions to a certain site. They are to be located in the site template folders (i.e. in /bitrix/templates/site_template/). Copying a component template using the system tools saves it in the folder: /bitrix/templates/site_template/components/namespace/component_name/template_name.
A component template is identified by the name. By default, templates have the name .default. If a template name is not specified, the default template is attached. Other templates can have arbitrary names.
The component templates can be represented by folders or files. If a template is a single file requiring no language dependent messages, certain styles or other resources, this template can be stored in a single file. Otherwise, templates should be stored in a folder.
A component template is atomic, i.e. it is an indivisible unit. If you need to customize a system template for a certain site, copy it to the site template folder.
For example, the bitrix:catalog.site.selector component has a dropdown system template located in the templates subfolder of the component folder:
If this component template requires customization, copy the folder of the dropdown template to /bitrix/templates/site_template/components/bitrix/catalog.site.selector/ and modify it there as required.