Answer the question
In order to leave comments, you need to log in
How to display 1 image from an array?
Hello, tell me pliz,
I have an infoblock, it has a file type property (multiple).
I display all pictures in this way.
<?if (!empty($arElement['PROPERTIES']['MORE_PHOTO']['VALUE'])):?>
<?foreach($arElement['PROPERTIES']['MORE_PHOTO']['VALUE'] as $photo):?>
<img src="<?=CFile::GetPath($photo)?>" />
<?endforeach?>
Answer the question
In order to leave comments, you need to log in
Can you do something like this
<?if($arElement['PROPERTIES']['MORE_PHOTO']['VALUE'][0]):?>
<img src="<?=CFile::GetPath($arElement['PROPERTIES']['MORE_PHOTO']['VALUE'][0]?>" />
<?endif?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question