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

/**
 * @var CBitrixComponentTemplate $this
 * @var CatalogElementComponent $component
 */
// получение банера
$IblockId=55;// инфоблок баннера
$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=56;// инфоблок баннера
$arResult['DIRECTIONS']=[];
$arFilter = Array(
    "IBLOCK_ID"=>$IblockId,
    "ACTIVE"=>"Y",

);
$arSelect = Array("ID", "IBLOCK_ID", "NAME","PROPERTY_COLOR");//IBLOCK_ID и ID обязательно должны быть указаны,

$res = CIBlockElement::GetList(Array(), $arFilter, false,false, $arSelect);
while($ob = $res->GetNextElement()) {
    $arItem = $ob->GetFields();
    $arResult['DIRECTIONS'][] = $arItem;
}

