Answer the question
In order to leave comments, you need to log in
How to get the ID of the current directory partition?
Hello! tell me -
How to get the ID of the current directory partition?
The CNC is built on a symbolic code, and on the page itself, the section ID of the current section is needed.
Answer the question
In order to leave comments, you need to log in
Getting section data in the section.php file of the catalog complex component by the section symbol code
<?
$rsSections = CIBlockSection::GetList(array(),array('IBLOCK_ID' => $arParams ['IBLOCK_ID'], '=CODE' => $arResult['VARIABLES']['SECTION_CODE']));
if ($arSection = $rsSections->Fetch())
{
echo $arSection['ID'];
}?>
First, try dumping the $arParams and $arResult variables.
If you don't find them, you can use the old API:
CIBlockSection::GetList as a filter to pass your infoblock id and section code
, or use d7 and orm:
$section = \Bitrix\Iblock\SectionTable::query()
->where('IBLOCK_ID', $iblockId)
->where('CODE', 'КОД РАЗДЕЛА')
->where('ACTIVE', 'Y')
->setSelect(['*'])
->exec()
->fetch()
;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question