Bitrix Site Manager

Page structure

In the Bitrix Site Manager, a page is a PHP file consisting of prologue, page body and epilogue.

A common page structure looks as follows:

<?
// include the prologue
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
?>
page body
<?
// include the epilogue
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");
?>

Due to the delay function technology, some visual elements displayed in prologue can be specified in the page body. Among these elements are:

The distinctive feature of this technology is allowing to delay execution of some functions by means of running them in the epilogue and placing the results of their execution in the preceding code.

But there is a number of tasks which cannot be settled using the delay function technology. This is referred to those cases when any actions are to be performed in the prologue with the values which would be specified in the page body in the previous example (for example: page properties). In this case it is essential to split the prologue into the service and visual sections and to specify those values between them. This is achieved in the following way:

<?
// include the prologue service section
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");

// for example, page property can be specified here
// using the function $APPLICATION->SetPageProperty
// and then process it in the epilogue visual section

// include the prologue visual section
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_after.php");
?>
Page content
<?
// include the epilogue
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");
?>

The prologue service section:

The main feature of the prologue service part is that it does not display any data (that is, does not send header to browser).

The prologue visual section includes the file /bitrix/templates/site template ID/header.php (site template ID is the current site template ID). This file stores the upper left part of the current site template.

As well as the prologue, the epilogue can be split into the visual and service sections.

<?
// include the prologue service section
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");

// include the prologue visual section
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_after.php");

?>
Page content
<?

// include the epilogue visual section
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_before.php");

// include the epilogue service section
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php");
?>

The epilogue visual section includes the file /bitrix/templates/site template ID/footer.php (site template ID is the current site template ID). This file stores the lower right part of the current site template. Besides, a set of invisible IFRAME's used by the user transfer technology is displayed.

The epilogue service section:

Often there appear tasks when the visual sections of prologue and epilogue are not necessarily to be included (for example, when using the Bitrix Web Analytics edition). In this case, it is enough to include the service sections of prologue and epilogue:

<?
// include the prologue service section
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
?>
page body
<?
// include the epilogue service section
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php");
?>

Note!
The service sections of both prologue and epilogue must be included for the system to operate correctly.

See Also