Views: 7493
Last Modified: 09.04.2014

Templates for the Bitrix Site Manager can be loaded in the system in <template_name>.tar.gz. format. Also the site template can be added by copying the template folder to the system.

The system templates management is implemented in the administrative section:

Settings -> System settings -> Sites -> Site templates.

There you can view, edit and upload the existing templates and also add new templates.

The possibility to view templates layout directly in the template list is realized by means of template capture using. The template capture should be located in the corresponding template folder with the screen.gif name (for example, /bitrix/templates/demo/screen.gif).

Template editing

To view or modify a template code use the Edit item in the template context menu.

The field Site template design contains the template code.

Click to enlarge

Note: the template contains a special separator #WORK_AREA# used to delimit the header and the footer sections.

This field displays a template as the joined header and footer parts of the site design in the PHP/HTML format. The code can contain component calls and different functions written in the PHP language that provide displaying of different information: metadata, page header, CSS, administrative toolbar etc. You can add and edit components and functions using the visual editor tools.

Template export

The special system interface features allow to export templates used in the system in the <file_name>.tar.gz format.

 

Template import

The Load template button allows to load templates in the system using the special system interface. To be available for import via system interface the templates must be saved in <template_name>.tar.gz format.

When the template is loaded it will be automatically unpacked and stored in the following directory: /bitrix/templates/<template_name>/.

Template creation

A new site template can be created directly in the system with use of the New template form. To go to this form use the Add template button located on the page context panel.

Creating the template via the system interface you can:

  • assign template ID (must be unique);
  • assign template name;
  • input template description for showing in template list;
  • input template source code;
  • assign used in template CSS;
  • define set of used in template pictures and include areas.

The new template is stored in the /bitrix/templates/<template_ID> directory (this directory is created automatically).

It is recommended to store all graphic files used in the template in the /bitrix/templates/<template_ID>/images/ directory.



Courses developed by Bitrix24