A
A
alfik1972018-02-11 13:48:58
1C-Bitrix
alfik197, 2018-02-11 13:48:58

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

2 answer(s)
I
I'm Yoda, 2018-02-11
@alfik197

<? foreach ($arResult["PROPERTIES"]["PHOTOS"]["VALUE"] as $arImgID): 
     $arImage[$arImgID] = CFile::GetFileArray($arImageID);?>
     <img src="<?= $arImage[$arImgID]["SRC"] ?>" alt="<?= $arResult["NAME"] ?>"/>
<? endforeach; ?>

$arResult or $arItem whatever you have there.

N
Nathan Stark, 2018-02-11
@MattLe

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 question

Ask a Question

731 491 924 answers to any question