<? if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) die();

// получение банера
$IblockId=31;// инфоблок баннера
$arResult['BANNER']=[];
$arFilter = Array(
    "IBLOCK_ID"=>$IblockId,
    "ACTIVE"=>"Y",

);
$res = CIBlockElement::GetList(Array(), $arFilter, false, array('nTopCount'=>1), $arSelect);
while($ob = $res->GetNextElement()) {
    $arItem = $ob->GetFields();
    $arItem['PREVIEW_PICTURE']= CFile::GetFileArray($arItem['PREVIEW_PICTURE']);
    $arItem['DETAIL_PICTURE']= CFile::GetFileArray($arItem['DETAIL_PICTURE']);
    $arItem['PROPERTIES'] = $ob->GetProperties();
    $arResult['BANNER']=$arItem;


}

// получение тегов
$iblockId = 32;

$arResult['SPECIALS'] = [];
$arSelect = array("ID", "IBLOCK_ID", "NAME", "PROPERTY_LINK");//IBLOCK_ID и ID обязательно должны быть
$arFilter = array("IBLOCK_ID" => $iblockId, "ACTIVE" => "Y");
$res = CIBlockElement::GetList(array("SORT"=>"ASC"), $arFilter, false, false, $arSelect);
while ($ob = $res->GetNextElement()) {
    $arFields = $ob->GetFields();
    $arResult['SPECIALS'][] = $arFields;
}


