битрикс каталог, есть множество разделов и в них лежат элементы. Хотел сделать индивидуальные включаемые области на каждый раздел и элементы. с элементами разобрался, вставал в шаблон элементов element.php следующую конструкцию:
<?
$APPLICATION->IncludeComponent("bitrix:main.include","",Array("AREA_FILE_SHOW" => "file", "PATH" => "/include/element_".$ElementID.".php"));
?>
А вот с разделами не получается сделать аналогичное
В шаблон компонента section.php вставляю
<?$APPLICATION->IncludeComponent("bitrix:main.include","",Array("AREA_FILE_SHOW" => "file","PATH" => "/include/section_".$SECTION_ID.".php"));?>
но при создании включаемой области не получаю ID из переменной $SECTION_ID.
подскажите, как её получить не пойму
ниже сам шаблон разделов
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
/** @var array $arParams */
/** @var array $arResult */
/** @global CMain $APPLICATION */
/** @global CUser $USER */
/** @global CDatabase $DB */
/** @var CBitrixComponentTemplate $this */
/** @var string $templateName */
/** @var string $templateFile */
/** @var string $templateFolder */
/** @var string $componentPath */
/** @var CBitrixComponent $component */
use Bitrix\Main\Loader;
use Bitrix\Main\ModuleManager;
$this->setFrameMode(true);
//$this->addExternalCss("/bitrix/css/main/bootstrap.css");
if (!isset($arParams['FILTER_VIEW_MODE']) || (string)$arParams['FILTER_VIEW_MODE'] == '')
$arParams['FILTER_VIEW_MODE'] = 'VERTICAL';
$arParams['USE_FILTER'] = (isset($arParams['USE_FILTER']) && $arParams['USE_FILTER'] == 'Y' ? 'Y' : 'N');
$isVerticalFilter = ('Y' == $arParams['USE_FILTER'] && $arParams["FILTER_VIEW_MODE"] == "VERTICAL");
$isSidebar = ($arParams["SIDEBAR_SECTION_SHOW"] == "Y" && isset($arParams["SIDEBAR_PATH"]) && !empty($arParams["SIDEBAR_PATH"]));
$isFilter = ($arParams['USE_FILTER'] == 'Y');
if ($isFilter)
{
$arFilter = array(
"IBLOCK_ID" => $arParams["IBLOCK_ID"],
"ACTIVE" => "Y",
"GLOBAL_ACTIVE" => "Y",
);
if (0 < intval($arResult["VARIABLES"]["SECTION_ID"]))
$arFilter["ID"] = $arResult["VARIABLES"]["SECTION_ID"];
elseif ('' != $arResult["VARIABLES"]["SECTION_CODE"])
$arFilter["=CODE"] = $arResult["VARIABLES"]["SECTION_CODE"];
$obCache = new CPHPCache();
if ($obCache->InitCache(36000, serialize($arFilter), "/iblock/catalog"))
{
$arCurSection = $obCache->GetVars();
}
elseif ($obCache->StartDataCache())
{
$arCurSection = array();
if (Loader::includeModule("iblock"))
{
$dbRes = CIBlockSection::GetList(array(), $arFilter, false, array("ID"));
if(defined("BX_COMP_MANAGED_CACHE"))
{
global $CACHE_MANAGER;
$CACHE_MANAGER->StartTagCache("/iblock/catalog");
if ($arCurSection = $dbRes->Fetch())
$CACHE_MANAGER->RegisterTag("iblock_id_".$arParams["IBLOCK_ID"]);
$CACHE_MANAGER->EndTagCache();
}
else
{
if(!$arCurSection = $dbRes->Fetch())
$arCurSection = array();
}
}
$obCache->EndDataCache($arCurSection);
}
if (!isset($arCurSection))
$arCurSection = array();
}
if ($isVerticalFilter)
include($_SERVER["DOCUMENT_ROOT"]."/".$this->GetFolder()."/section_vertical.php");
else
include($_SERVER["DOCUMENT_ROOT"]."/".$this->GetFolder()."/section_horizontal.php");
?>
<?
global $APPLICATION;
$APPLICATION->IncludeComponent("bitrix:main.include","",Array("AREA_FILE_SHOW" => "file","PATH" => "/local/includes/form_order.php","SECTION"=>$APPLICATION->GetTitle()));
?>
<?
$APPLICATION->IncludeComponent("bitrix:main.include","",Array("AREA_FILE_SHOW" => "file","PATH" => "/include/section_".$SECTION_ID.".php"));
?>