Answer the question
In order to leave comments, you need to log in
How to make a slider to insert into the body of a bitrix article?
Good afternoon,
How to make an image slider from the news
The following was done, but I don’t understand further:
1. Added a new MORE_PHOTO property for the news infoblock.
2. The result_modifier.php file has been created with the following content:
<?
$arResult["MORE_PHOTO"] = array();
if(isset($arResult["PROPERTIES"]["MORE_PHOTO"]["VALUE"]) && is_array($arResult["PROPERTIES"]["MORE_PHOTO"]["VALUE"])){
foreach($arResult["PROPERTIES"]["MORE_PHOTO"]["VALUE"] as $FILE) {
$FILE = CFile::GetFileArray($FILE);
if(is_array($FILE))
$arResult["MORE_PHOTO"][] = $FILE;
}
}
?>
<?
$LINE_ELEMENT_COUNT = 2;
if(count($arResult["MORE_PHOTO"])>0):?>
<?foreach($arResult["MORE_PHOTO"] as $PHOTO):?>
<? $file = CFile::ResizeImageGet($PHOTO, array('width'=>300, 'height'=>'300'), BX_RESIZE_IMAGE_EXACT, true); ?>
<img src="<?=$file["src"]?>" width="300" height="300">
<?endforeach?>
<?endif?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question