Answer the question
In order to leave comments, you need to log in
How to display an image from the infoblock property?
Hello, tell me how to display the properties of the infoblock (file, plural)
Guys, there is an ifnoblock, I created a property of the file type. I create an element, I upload a photo. and I don't know how to display it in the template as img src
thanks!
Answer the question
In order to leave comments, you need to log in
<? foreach ($arResult["PROPERTIES"]["PHOTOS"]["VALUE"] as $arImgID):
$arImage[$arImgID] = CFile::GetFileArray($arImageID);?>
<img src="<?= $arImage[$arImgID]["SRC"] ?>" alt="<?= $arResult["NAME"] ?>"/>
<? endforeach; ?>
How do you display the data of this IB? via api or component?
I know that there is a problem in the components, they do not see the properties of the file type, and then you just write it manually in the input under the list of properties. but in general, output the arResult array in the template and you can find your property there
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question