Answer the question
In order to leave comments, you need to log in
How to display a property via GetList in Bitrks?
I need to pull the MORE_PHOTO property.
Here is a piece of code in catalog.section.list
$arSelect = array(
'PROPERTY_MORE_PHOTO',
'PREVIEW_PICTURE',
'DETAIL_PICTURE',
);
foreach ($arResult["SECTIONS"] as &$arSection) {
$rsPhotoElements = CIBlockElement::GetList(array("SORT" => "ASC", "NAME" => "ASC"),
array("IBLOCK_ID" => $arParams["IBLOCK_ID"], "SECTION_ID" => $arSection["ID"], "ACTIVE" => "Y"),
false,
false,
$arSelect);
$i = 4;
while ($i && $arElement = $rsPhotoElements->GetNext()) {
$photo = CFile::ResizeImageGet($arElement["DETAIL_PICTURE"],
array('width'=>200, 'height'=>180),
BX_RESIZE_IMAGE_PROPORTIONAL);
$arElement["PREVIEW_PICTURE"] = $photo['src'];
$arElement["DETAIL_PICTURE"] = CFile::GetFileArray($arElement["DETAIL_PICTURE"]);
$arElement["PROPERTY_MORE_PHOTO"] = CFile::GetFileArray($arElement["PROPERTY_MORE_PHOTO"]);
$arSection["ELEMENTS"][] = $arElement;
$i--;
}
}
var_dump($arElement["PREVIEW_PICTURE"]);
var_dump($arElement["PROPERTY_MORE_PHOTO"]);
Answer the question
In order to leave comments, you need to log in
In general, I did like this in modifire
$arSelect = array(
'PROPERTY_MORE_PHOTO',
'PREVIEW_PICTURE',
'DETAIL_PICTURE',
);
foreach ($arResult["SECTIONS"] as &$arSection) {
$rsPhotoElements = CIBlockElement::GetList(array("SORT" => "ASC", "NAME" => "ASC"),
array("IBLOCK_ID" => $arParams["IBLOCK_ID"], "SECTION_ID" => $arSection["ID"], "ACTIVE" => "Y"),
false,
false,
$arSelect);
$i = 4;
while ($i && $arElement = $rsPhotoElements->GetNext()) {
$photo = CFile::ResizeImageGet($arElement["DETAIL_PICTURE"],
array('width'=>200, 'height'=>180), BX_RESIZE_IMAGE_PROPORTIONAL);
$arElement["PREVIEW_PICTURE"] = $photo['src'];
$arElement["DETAIL_PICTURE"] = CFile::GetFileArray($arElement["DETAIL_PICTURE"]);
$arElement["PROPERTY_MORE_PHOTO"] = CFile::GetFileArray($arElement["PROPERTY_MORE_PHOTO"]);
$arSection["ELEMENTS"][] = $arElement;
$i--;
}
}
<div class = "fancybox_slider" id = "slider_gallery">
<?foreach ($arResult["SECTIONS"] as $arSection) {?>
<?foreach ($arSection["ELEMENTS"] as $arItem) {?>
<?=$arItem["PROPERTY_MORE_PHOTO"]?>
<?}?>
<?}?>
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question