Answer the question
In order to leave comments, you need to log in
How (in a template) using PHP to hide the Bitrix property if it is empty?
This is how I display the "Bitrix" property in the template:
<div class="article iblock" <?if($arResult['SHOW_OFFERS_PROPS']){?>id="<? echo $arItemIDs["ALL_ITEM_IDS"]['DISPLAY_PROP_ARTICLE_DIV'] ?><?}?>>
<span class="far fa-info-circle" style="font-size: 16px; color: #999;"></span>
<span class="block_title" itemprop="name"><?=$arResult["PROPERTIES"]["CML2_ARTICLE"]["NAME"];?>:</span>
<span class="value" itemprop="value"><?=$arResult["PROPERTIES"]["CML2_ARTICLE"]["VALUE"]?></span>
</div>
Answer the question
In order to leave comments, you need to log in
<div class="article iblock" <?if($arResult['SHOW_OFFERS_PROPS']){?>id="<? echo $arItemIDs["ALL_ITEM_IDS"]['DISPLAY_PROP_ARTICLE_DIV'] ?><?}?>>
<span class="far fa-info-circle" style="font-size: 16px; color: #999;"></span>
<? if (!empty($arResult["PROPERTIES"]["CML2_ARTICLE"]["VALUE"])){?>
<span class="block_title" itemprop="name"><?=$arResult["PROPERTIES"]["CML2_ARTICLE"]["NAME"];?>:</span>
<span class="value" itemprop="value"><?=$arResult["PROPERTIES"]["CML2_ARTICLE"]["VALUE"]?></span>
<?}?>
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question