Answer the question
In order to leave comments, you need to log in
How to display a custom field?
In general, everything works except that the property is displayed only when it is filled, that is, this construction <? if ($arResult["UF_HEADER_PHOTO_1"]) { ?> does not work, tell me how to write it correctly?!
<? if ($arResult["UF_HEADER_PHOTO_1"]) { ?>
<?
$ar_result = CIBlockSection::GetList(Array("SORT" => "ASC"), Array("IBLOCK_ID" => "71", "ID" => $arCurSection["ID"]), false, Array("UF_HEADER_PHOTO_1"));
if ($res = $ar_result->GetNext()) {
echo "<h2>" . $res["UF_HEADER_PHOTO_1"] . "</h2>";
}
?>
<? } ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question