<? 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"=>355

);
$arSelect = Array("ID", "IBLOCK_ID", "NAME","PREVIEW_TEXT","PROPERTY_TITLE","PROPERTY_TAG");//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'];

}

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

$arResult['SPECIALS'] = [];
$arSelect = array("ID", "IBLOCK_ID", "NAME", );//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;
}


?>
