E
E
Eugene M2019-03-26 20:43:01
1C-Bitrix
Eugene M, 2019-03-26 20:43:01

How to display an additional property of a section in Bitrix?

Everything went too far, nothing works, but it would seem a simple question! How to withdraw?
This one displays, but for some reason, all sections at once, but a specific section needs only its property filled.

<? 
$db_list = CIBlockSection::GetList(Array($by=>$order), $arFilter = Array("IBLOCK_ID"=>25, "ID"=>$arResult["IBLOCK_SECTION_ID"]), true,$arSelect=Array("UF_NEWH1")); 
while($ar_result = $db_list->GetNext()):   
?> 
<?=$ar_result["UF_NEWH1"] ?>
<? endwhile?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Panteleev, 2019-03-26
@s_panteleev

$iblockId = 25;
$sectionId = 37;

\Bitrix\Main\Loader::includeModule('iblock');

// вариант 1
$field = $USER_FIELD_MANAGER->GetUserFields('IBLOCK_25_SECTION', $sectionId);
$value = $field['UF_NEWH1']['VALUE'];
print_r($value);

// вариант 2
$res = CIBlockSection::GetList([], ['IBLOCK_ID' => $iblockId, 'ID' => $sectionId], false, ['IBLOCK_ID', 'ID', 'UF_NEWH1'])->Fetch();
$value = $res['UF_NEWH1'];
print_r($value);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question