Answer the question
In order to leave comments, you need to log in
How to get the Character Code of the section that contains the element, given both the ID of this section and the ID of the element?
When printing print_r, there is an element ID and a section ID in which it is located, but the directory is built by CNC and the character code of the section in which the element is located is needed there.
All this is done to build the NC link before viewing the item in detail.
At the same time, [DETAIL_PAGE_URL] => #SITE_DIR#/1/2/3/#SECTION_CODE#/#ELEMENT_ID#/,
where 1,2,3 are index pages of different physical sections.
Answer the question
In order to leave comments, you need to log in
Issue resolved if anyone is interested.
$res = CIBlockSection::GetByID($arElement["IBLOCK_SECTION_ID"]);
if($ar_res = $res->GetNext()) {
echo $ar_res['SECTION_PAGE_URL'];
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question