Bitrix Site Manager

Page templates

A page template is a PHP file whose content conforms to the rules of forming the page structure. Page templates can be used when creating a new page in the module Site Explorer.

Page templates are stored in the following folders:

Each of these folders may contain page template files and a service file .content.php whose main task is to store the descriptions and of page template sort order. This information is stored in the array $TEMPLATES, whose structure is presented below:

Array
(
    [file name] => Array
        (
            [name] => page template title
            [sort] => sort weight
        )

)

When building the list of page templates, the following algorithm is used.

  1. Obtain the site template ID for the current site which is included without the PHP condition;
  2. Consecutively include files:
    1. /bitrix/templates/.default/page_templates/.section.php
    2. /bitrix/templates/site template ID/page_templates/.section.php
    In each of these files, a correspondent array $TEMPLATES is described. After including these files, we will have a combined array $TEMPLATES. Then, perform the following actions for each element of this array, being a description of a page template:
    1. check whether the page template physically exists;
    2. if it does, add it to the list of templates.
  3. Sort the obtained list of templates by the sort weight   (see the structure of the array $TEMPLATES above).

See Also