Forked from karpovets/Вывод изображений из множественного свойства типа файл в Битрикс
Created
June 14, 2020 20:54
-
-
Save Elvinz/9f4cbbbf56320e34aba00a60acf86ef5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?if (!empty($arResult["PROPERTIES"]["MORE_PHOTO"]["VALUE"])):?> | |
<?foreach($arResult["PROPERTIES"]["MORE_PHOTO"]["VALUE"] as $photo):?> | |
<img src="<?=CFile::GetPath($photo)?>" /> | |
<?endforeach?> | |
<?endif?> | |
//Пояснения: MORE_PHOTO — это код нашего свойства информационного блока в Битрикс. GetPath это метод класса CFile, который просто возвращает путь к нашему изображению — зарегистрированному файлу. И выводить элементы лучше из массива $arResult[«DISPLAY_PROPERTIES»] — давайте уважать редакторов контента =) | |
//Если нам нужно сразу отмасштабировать изображение… |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment