Began to comprehend the bitrix, created the information block.

if(CModule::IncludeModule("iblock")) { $id_block=1; $section_id = 0; // выберем 10 элементов из папки $ID информационного блока $BID $items = GetIBlockElementList($id_block, $section_id, Array("SORT"=>"ASC"), 3); $items->NavPrint("пользователи"); while($arItem = $items->GetNext()) { echo $arItem["ID"]."<br>"; echo $arItem["NAME"]."<br>"; print_r($arItem['DISPLAY_PROPERTIES']['NAME']['DISPLAY_VALUE'] ); } } 

Information block id = 1, there are no sections in it. Only the item name and its ID are displayed. I just can not figure out how to get to the properties of the elements.

  • Fixed, be tolerant to other people's errors. - votanko
  • The documentation also says what to do. - u_mulder
  • I am aware of how to get separately to the property. $ arIBlockElement = GetIBlockElement (3, "users_block"); print_r ($ arIBlockElement ['PROPERTIES'] ['NAME'] ['VALUE']); I can not understand how beautiful it is to stick it in so that the name of the element and its properties are displayed. - votanko
  • one
    I would advise using CIBlockElement::GetList - Nikolaj Sarry
  • left, or still need more help? - Oleksandr

2 answers 2

After long attempts it turned out like this:

 $sResult = ""; if (CModule::IncludeModule('iblock')) { $iBlock = 1; $arSelect = Array("ID", "IBLOCK_ID", "NAME", "DATE_ACTIVE_FROM", "PROPERTY_*"); $arFilter = array("IBLOCK_ID" => $iBlock, "ACTIVE_DATE" => "Y", "ACTIVE" => "Y"); $res = CIBlockElement::GetList(Array(), $arFilter, false, false, $arSelect); while ($ob = $res->GetNextElement()) { $arFields = $ob->GetFields(); $sResult = $sResult . "ID element: " . $arFields['ID'] . ". User: " . $arFields['NAME']; $arProps = $ob->GetProperties(); $sResult = $sResult . "<br>ID User: " . $arProps['ID']['VALUE'] . ". Name user: " . $arProps['NAME']['VALUE'] . "<br>"; } } 
  • And tell me - what's the catch in writing the infoblock code yourself? Established means of Bitrix, where everything is already written before us, isn't it enough? - humster_spb
  • Here I did not write the information block code, but took the information from its elements. All functions here are standard bitrix. - votanko
 if(CModule::IncludeModule("iblock")) { $id_block=1; $items = СIBlockElement::GetList(array(), array('IBLOCK_ID'=>$id_block)); while($arItem = $items->GetNext()) { ?><pre><?print_r($arItem);?></pre><? } } 
  • You will be surprised, but with such a request the properties will not stretch. Well, C English should be. - u_mulder pm