Documentation

SetSectionContext

void
CIBlockResult::SetSectionContext(
array arSection
);

The method sets section fields as parent of element for inserting into templates via method CIBlockResult::GetNext. When parent section is not defined via calling this method, fields from section with minimal IDs to which the element is binded are used for inserting into template. Non static method.

Note: This method is used in complements for saving a section, currently viewed by the user and when multiple minded elements are used.

Call parameters

Parameter Description
arSection Array of section fields used for inserting values into template path.

Returned value

Returns nothing.

See Also

Examples

<?
$rsElements = CIBlockElement::GetList(array(), array("ID" => $ID), false, false, array("ID", "NAME", "DETAIL_PAGE_URL"));
$rsElements->SetUrlTemplates("/catalog/#SECTION_CODE#/#ELEMENT_CODE#.php");
$rsElements->SetSectionContext($arSection);
$arElement = $rsElements->GetNext();
?>


© «Bitrix24», 2001-2024
Up