N
N
newked2021-04-21 21:25:27
1C-Bitrix
newked, 2021-04-21 21:25:27

How to display elements of a certain section of an infoblock on Bitrix?

Guys, tell me how you can display the elements of a certain section of the infoblock?
I found this code online:

<?
CModule::IncludeModule("iblock");
$BID = 2;   //ID инфоблока
$SID = 2;   //ID секции
$result = CIBlockElement::GetList(
   Array("ID"=>"DESC"), 
   Array("IBLOCK_ID"=>IntVal($BID), "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y","SECTION_ID"=>$SID), 
   false, 
   Array("nPageSize"=>3), 
   Array("ID", "NAME", "DETAIL_PAGE_URL")
);
while($arResultmy = $result->GetNext()){
echo '<div>'.$arResultmy['NAME'].'</div>';
}
?>


The code works, but I don't understand how using this code to display the created properties of the elements. Guys, help, who can))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
newked, 2021-04-22
@newked

In the settings of the news module (news.list) there is a section "Additional settings" .... there is an ID field. It is enough to specify the desired section ID and the module will display only those elements that are in this section.
60809782debd0445036389.jpeg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question