Answer the question
In order to leave comments, you need to log in
How to display an element in the presence of a property (Bitrix)?
Hello. There is a property in element properties. If there is a property, you need to display elements with this property in one block. If the property is empty, then the elements without the property are placed in another block.
How to do it?
Answer the question
In order to leave comments, you need to log in
The question is rather vaguely written.
If we are talking about how to separate elements with a filled property from elements with an empty one, you can do this:
$IblockID = 1;
$res = CIBlockElement::GetList([], ['IBLOCK_ID' => $IblockID], false, false, ['IBLOCK_ID', 'NAME', 'PROPERTY_ISEMPTY']);
while($item = $res -> Fetch())
{
if($item['PROPERTY_ISEMPTY_VALUE'])
{
$arResult['FILLED'][] = $item;
}
else
{
$arResult['EMPTY'][] = $item;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question