Views: 4709
Last Modified: 10.04.2014
Editable area of site template
Editable areas of site template are stored as PHP and HTML files that are assigned to the site template with use of the function IncludeFile()
. Path to the file with editable area is used as the function parameter:
<?
$APPLICATION->IncludeFile(SITE_DIR."include/phone.php",
Array(),
Array("MODE"=>"html")
);
?>
To proceed to template editable area modification use the icon
displayed in the Edit Mode.
![](/images/integration_course_en/features/incl_template.png)
or open for editing file with the necessary area.
![](/images/integration_course_en/features/file_edit.png)
Editable area of the certain file or section
Editable areas for file or section are stored as files with names containing a definite suffix. Suffix used for editable areas is defined in site template.
For example, by default, it is implied that:
To proceed to an editable area creating or editing you can:
- use the icon
displayed in the place intended for editable area show. This icon is displayed in the editable areas show mode;
- create or open for editing a file with the proper name using the File manager tools.
Editable areas are created on base of templates stored in folders with the names /page_templates/
:
/bitrix/templates/.default/page_templates/
- in case if this editable area template is utilized for all site templates;
/bitrix/templates/<template_ID>/page_templates/
- in case if for this site template are used individual editable areas templates.
If you want the editable areas to be added to the list of available templates of WYSIWYG editor, add the editable area templates manes in the file .content.php
.
The file .content.php
is stored in the folder /page_templates/
located in the corresponding template directory.
![](/images/framework_en/create_page.png)
Also the name of utilized template can be defined with use of special parameter while assigning editable area to the site. (see the code spotlighted with blue color in the example below).
Assigning editable areas to site templates is implemented with use of the function IncludeFile()
, places in the necessary areas of site template:
<?
$APPLICATION->IncludeFile(substr($APPLICATION->GetCurPage(),
0, strlen($APPLICATION->GetCurPage())-4)."_inc.php", Array(),
Array("MODE"=>"html", "NAME"=>GetMessage("PAGE_INC"), "TEMPLATE"=>"page_inc.php"));
?>
<?
$APPLICATION->
IncludeFile($APPLICATION->GetCurDir()."sect_inc.php", Array(), Array("MODE"=>"html",
"NAME"=>GetMessage("SECT_INC"), "TEMPLATE"=>"sect_inc.php"));
?>