E
E
Eugene M2021-02-04 06:38:19
1C-Bitrix
Eugene M, 2021-02-04 06:38:19

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

1 answer(s)
E
Eugene M, 2021-02-04
@hotwind

<?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 question

Ask a Question

731 491 924 answers to any question