How to withdraw additional property section in Bitrix?

All peregoy, nothing works, and it would seem a simple question! How to withdraw?
Such displays but for some reason, all sections, and you need to have a specific section only 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?>
March 19th 20 at 08:43
1 answer
March 19th 20 at 08:45
$iblockId = 25;
$sectionId = 37;

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

// option 1
$field = $USER_FIELD_MANAGER->GetUserFields('IBLOCK_25_SECTION', $sectionId);
$value = $field['UF_NEWH1']['VALUE'];
print_r($value);

// option 2
$res = CIBlockSection::GetList([], ['IBLOCK_ID' => $iblockId, 'ID' => $sectionId], false, ['IBLOCK_ID', 'ID', 'UF_NEWH1'])->Fetch();
$value = $res['UF_NEWH1'];
print_r($value);
All good, but $sectionId = 37; sections very much like to do to output without specifying the ID section? - percy.Satterfield commented on March 19th 20 at 08:48
Pass the desired variable, for example, from your code – $arResult["IBLOCK_SECTION_ID"] - Alvena_Treutel16 commented on March 19th 20 at 08:51
@Alvena_Treutel16, how to learn it? - percy.Satterfield commented on March 19th 20 at 08:54
@makarovpro, anyone?)

$field = $USER_FIELD_MANAGER->GetUserFields('IBLOCK_25_SECTION', $arResult["IBLOCK_SECTION_ID"]);
$value = $field['UF_NEWH1']['VALUE'];
- Alvena_Treutel16 commented on March 19th 20 at 08:57
@Alvena_Treutel16, do not quite understand option 1 does not work error, second the only way, but in the second substitute sectionId dynamically!?

<?
$iblockId = 25;
$sectionId = 247;

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

// option 2
$res = CIBlockSection::GetList([], ['IBLOCK_ID' => $iblockId, 'ID' => $sectionId], false, ['IBLOCK_ID', 'ID', 'UF_NEWH1'])->Fetch();
$value = $res['UF_NEWH1'];
print_r($value);

 ?>
- percy.Satterfield commented on March 19th 20 at 09:00
So substitute)
$res = CIBlockSection::GetList([], ['IBLOCK_ID' => $iblockId, 'ID' => $arResult["IBLOCK_SECTION_ID"]], false, ['IBLOCK_ID', 'ID', 'UF_NEWH1'])->Fetch();
- Alvena_Treutel16 commented on March 19th 20 at 09:03
@Alvena_Treutel16unfortunately it is not working. - percy.Satterfield commented on March 19th 20 at 09:06
@makarovpro, and in what place you call?
What displays?
var_dump($arResult["IBLOCK_SECTION_ID"]); - Alvena_Treutel16 commented on March 19th 20 at 09:09
@Alvena_Treutel16displays NULL - percy.Satterfield commented on March 19th 20 at 09:12
@makarovpro, so it's not defined.
In which you component this code print? - Alvena_Treutel16 commented on March 19th 20 at 09:15
@Alvena_Treutel16, \components\bitrix\catalog\.default\section.php - percy.Satterfield commented on March 19th 20 at 09:18
@makarovproyou write code before calling the component bitrix:catalog.section or after?

If after, try this:
$sectionId = $APPLICATION->IncludeComponent(
"bitrix:catalog.section"
"",
array(
 // component properties
),
$component
);

$res = CIBlockSection::GetList([], ['IBLOCK_ID' => $iblockId, 'ID' => $sectionId], false, ['IBLOCK_ID', 'ID', 'UF_NEWH1'])->Fetch();
- Alvena_Treutel16 commented on March 19th 20 at 09:21
@Alvena_Treutel16, it writes invalid information unit
<?
 $iblockId = 36;
 $sectionId = 247;

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

 $sectionId = $APPLICATION->IncludeComponent(
"bitrix:catalog.section"
"",
array(
 // component properties
),
$component
);

 $res = CIBlockSection::GetList([], ['IBLOCK_ID' => $iblockId, 'ID' => $sectionId], false, ['IBLOCK_ID', 'ID', 'UF_NEWH1'])->Fetch();
 $value = $res['UF_NEWH1'];
print_r($value);
 ?>
- percy.Satterfield commented on March 19th 20 at 09:24
@makarovpro, show me the code of file /components/bitrix/catalog/.default/section.php? - Alvena_Treutel16 commented on March 19th 20 at 09:27
@Alvena_Treutel16, does not fit here, here https://1drv.ms/u/s!AhQ8b1yOKukIhlmah4cl4qjtZ1vi - percy.Satterfield commented on March 19th 20 at 09:30
@makarovpro, please output:
var_dump($arCurSection["ID"]);

it displays the partition ID, which is necessary to obtain a property or something else? - Alvena_Treutel16 commented on March 19th 20 at 09:33
@Alvena_Treutel16, thanks so it seems to work, will test. - percy.Satterfield commented on March 19th 20 at 09:36

Find more questions by tags 1C-Bitrix