Answer the question
In order to leave comments, you need to log in
How to display a property with verification in Bitrix?
Tell me please! The property itself is displayed without a check (search.page template), how to write the check correctly so that it is displayed only when the value is not empty, for some reason the code below does not work:
<?if (!empty($arResult['PROPERTIES']['CML2_ARTICLE']['VALUE'])):?>
<?= $arResult["ELEMENTS"][$arItem["ITEM_ID"]]["PROPERTY_CML2_ARTICLE_VALUE"]?>
<?endif?>
Answer the question
In order to leave comments, you need to log in
<?if ($arResult["ELEMENTS"][$arItem["ITEM_ID"]]["PROPERTY_CML2_ARTICLE_VALUE"]):?>
<div class="article_block">
<div class="muted font_sxs">
<?=GetMessage("SEARCH_ARTICLE")?>
<?= $arResult["ELEMENTS"][$arItem["ITEM_ID"]]["PROPERTY_CML2_ARTICLE_VALUE"]?>
</div>
</div>
<?endif?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question