Answer the question
In order to leave comments, you need to log in
BITRIX: how to display a property correctly?
Hello.
People, tell me, please,
In the infoblock I created the "File" property, multiple. Uploaded .pdf files to it.
I need to display the file name from an array.
If there is one element, then it turns out to be done like this:
<?=$arResult["DISPLAY_PROPERTIES"]["FILE"]["FILE_VALUE"]["ORIGINAL_NAME"];?>
<?if(is_array($arResult["DISPLAY_PROPERTIES"]["FILE"]["FILE_VALUE"]["ORIGINAL_NAME"])):?> <?foreach($arResult["DISPLAY_PROPERTIES"]["FILE"]["FILE_VALUE"] as $pid=>$arProperty):?>
<?$arProperty["ORIGINAL_NAME"]?>
<?endforeach;?>
<?else:?>
<?=$arResult["DISPLAY_PROPERTIES"]["FILE"]["FILE_VALUE"]["ORIGINAL_NAME"];?>
<?endif?>
<?=$arResult["DISPLAY_PROPERTIES"]["FILE"]["FILE_VALUE"]["ORIGINAL_NAME"];?>
Answer the question
In order to leave comments, you need to log in
you are checking for is_array like this
$arResult["DISPLAY_PROPERTIES"]["FILE"]["FILE_VALUE"]["ORIGINAL_NAME"]
$arResult["DISPLAY_PROPERTIES"]["FILE"]["FILE_VALUE"]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question