<code> if($componentPage == ‘element’){ if(1){ $uf_arresult = CIBlockSection::GetList(Array(«SORT»=>»ASC»), Array(«IBLOCK_ID» => $arParams[‘IBLOCK_ID’], «CODE» => $arVariables[‘SECTION_CODE’]), false); if($uf_value = $uf_arresult->GetNext()){ //print_r($arVariables); }else{ $reserer = CIBlockElement::GetList(Array(), [‘IBLOCK_ID’=>$arParams[‘IBLOCK_ID’],’CODE’=>$arVariables[‘ELEMENT_CODE’]], false, Array(«nPageSize»=>1), [‘DETAIL_PAGE_URL’]); while($oberfdsf = $reserer->GetNextElement()) { $arFieldsererer = $oberfdsf->GetFields(); if($arFieldsererer[‘DETAIL_PAGE_URL’] != $_SERVER[‘REQUEST_URI’]){ LocalRedirect($arFieldsererer[‘DETAIL_PAGE_URL’]); } } } } } </code>
Комментарии к интересностям