Answer the question
In order to leave comments, you need to log in
How to exclude 1 additional property in Bitrix when displaying through foreach?
Good evening
Tell me how to exclude 1 additional property in Bitrix so that it is not displayed on the page in the foreach loop?
In more detail:
The infoblock has several additional properties, about 10, all of them are displayed by the foreach loop on the page in one place.
And there is a task to display a video on the page, which is also displayed through an additional property. There are no particular problems with this, we display it simply as one additional property.
But there is a nuance that in the block with fields that are displayed in a cycle, a link to the video is displayed, but it is completely useless.
The question is how to exclude the video property from foreach?
I know that you can display each field separately, but I don't want to pile up the code.
Thank you.
Answer the question
In order to leave comments, you need to log in
Do a check on the property code and break the iteration at an unnecessary one
. Example:
foreach($arResult["PROPERTIES"] as $arProp)
{
if(in_array($arProp["CODE"], array("TEST_CODE"))) continue;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question