- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
foreach ($arResult["ITEMS"] as $key => $arItem)
{
$res = CIBlockSection::GetList(array(), array("ID" => $arItem['IBLOCK_SECTION_ID']), false, array("SECTION_PAGE_URL", "NAME"));
if($ar_res = $res->GetNext())
$arResult["ITEMS"][$key]["SECTION_URL"] = '<a href="'.$ar_res["SECTION_PAGE_URL"] .'">'.$ar_res["NAME"].'</a>';
$arResult["ITEMS"][$key]["SECTION_URI"] = $ar_res['SECTION_PAGE_URL'];
$arResult["ITEMS"][$key]["SECTION_NAME"] = $ar_res['NAME'];
if(is_array($arItem["PREVIEW_PICTURE"]))
{
$arFileTmp = CFile::ResizeImageGet(
$arItem["PREVIEW_PICTURE"],
array("width" => $arParams["DISPLAY_IMG_WIDTH"], "height" => $arParams["DISPLAY_IMG_HEIGHT"]),
BX_RESIZE_IMAGE_EXACT,
true
);
$arResult['ITEMS'][$key]['PREVIEW_PICTURE']['SRC'] = $arFileTmp['src'];
}
$arResult['ITEMS'][$key]["NAME"] = TruncateText($arResult['ITEMS'][$key]["NAME"],45);
$arResult['ITEMS'][$key]["PREVIEW_TEXT"] = TruncateText($arResult['ITEMS'][$key]["PREVIEW_TEXT"],80);
}
?>
Я программист 1C-bitrix и с каждой новой итерацией я делаю новый запрос к инфоблоку.