K
K
Kilster2019-12-04 01:35:03
1C-Bitrix
Kilster, 2019-12-04 01:35:03

How to display data from a custom field of the "File" type in 1C:Bitrix?

Good day to all!
There are many product sections. On each of them I want to display my image for the section. I'm trying to do it through a custom field of the "File" type (UF_BANNER), but it is not displayed on the page.
5de6e257dad83995831636.png
Tried output by adding <?=CFile::GetPath($UF_BANNER);?>, <?=CFile::GetPath("UF_BANNER");?> or <?=CFile::GetPath(20);?> (20 - parameter ID) into the page template, but to no avail.
Question: how to display different images through a custom field on different section pages?
I would appreciate any help for a newbie.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2019-12-04
@anton99zel

<?
$fileimg = CFile::ResizeImageGet($arSection['UF_BANNER'], 
array('width'=>1000, 'height'=>200), 
BX_RESIZE_IMAGE_PROPORTIONAL_ALT, true);
?>
<img src="<?=$fileimg[src]?>">

Maybe not $arSection, but $arItem

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question