The contents of include areas are stored in separate PHP or HTML files. Areas for pages or sections are saved with a suffix. E.g., in the product files supplied the suffix _inc is used as a designation of the include area for a page, and the include area for a site section is stored in the sect file with a suffix added (e.g., sect_inc.php).

Important! The file with include area must be saved in the same directory with the page for which it was created. Include area for a section must be saved in the folder of this section.

Areas in the site design template should be connected using the component Insert include area or using the function of IncludeFile().

The suffix used for the designation of include areas is determined by the option having the same name in the settings of the component Insert include area. The component may be located not only in the design template but also on the site pages, provided that file suffix must be set as different from that used in the template.

Note: The type of the include area is determined by the parameter Show include area of the component Insert include area.
If the component is located in the site design template, the information from file will be displayed on the entire site. Parameter setup is available only for users with the operation Edit PHP code (edit_php) at the kernel module access level.

Include Area Layout

In order to place the include area proceed as follows:

Open a site template or a page in a visual editor for editing.

Add the component Insert include area (bitrix:main.include) to the site template (or page body) and set up its parameters.

Creating and Editing the Include Area

Include areas may be created:

From the administrative section in Ste Explorer (Control Panel > Content > Site Explorer > Files and Folders) by creating a file with the relevant name;

From the public section of the site in the edit mode. In the places where include areas are supposed to be displayed, the icons will be shown for quick access to creation of these areas.

Note: A file of the include area will be created and named in accordance with the suffix indicated in the component settings – for the option for section, or a file name – for the option from file.

After the command of Add Area is selected, visual editor will be launched to create the contents of the include area. If the command of Edit Area as PHP is selected, it will become possible to add an area in the PHP code mode.

Likewise, it is possible to switch to editing of include areas as follows:

Directly from the public section of the site in the edit mode

Or from the administrative section by opening relevant file in Site Explorer for editing.

Attention! If the option from file is used as include area, you have to check that the file is connected from the system and not accessed directly. It should be done using the following line:
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>.
Example of contents of included file: