Answer the question
In order to leave comments, you need to log in
Bitrix.How to get infoblock element id?
I have an infoblock, it has elements, I need to find out the id of these elements and put them in a loop, what will the call example look like?
Answer the question
In order to leave comments, you need to log in
<?php
if (\Bitrix\Main\Loader::includeModule('iblock')) {
$elementIterator = \Bitrix\Iblock\ElementTable::getList([
'select' => [
'*',
],
'filter' => [
'=IBLOCK_ID' => 1,
]
]);
foreach ($elementIterator->fetchAll() as $element) {
echo '<pre>';print_r($element);echo '</pre>';
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question