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

/**
 * @var CBitrixComponentTemplate $this
 * @var CatalogElementComponent $component
 */
$IblockId=59;// инфоблок баннера
$arFilter = Array(
    "IBLOCK_ID"=>$IblockId,
    "ACTIVE"=>"Y",
    "ID"=>371

);
$arSelect = Array("ID", "IBLOCK_ID", "NAME","PREVIEW_TEXT","PROPERTY_TITLE","PROPERTY_IMG","PROPERTY_TAG","PROPERTY_LINK", "PROPERTY_BTN_TEXT");
//IBLOCK_ID и ID

$res = CIBlockElement::GetList(Array(), $arFilter, false,array('nTopCount'=>1), $arSelect);
while($ob = $res->GetNextElement()) {
    $arItem = $ob->GetFields();
    $arResult['NAME'] = $arItem['~PROPERTY_TITLE_VALUE']['TEXT'];
    $arResult['TAG'] = $arItem['PROPERTY_TAG_VALUE'];
    $arResult['LINK'] = $arItem['PROPERTY_LINK_VALUE'];
    $arResult['BTN_TEXT'] = $arItem['PROPERTY_BTN_TEXT_VALUE'];

}
