<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
// cache hack to use items list in component_epilog.php
$this->__component->arResult["IDS"] = array();
$this->__component->arResult["OFFERS_IDS"] = array();
if(isset($arParams["DETAIL_URL"]) && strlen($arParams["DETAIL_URL"]) > 0)
$urlTemplate = $arParams["DETAIL_URL"];
else
$urlTemplate = CIBlock::GetArrayByID($arParams["IBLOCK_ID"], "DETAIL_PAGE_URL");
//2 Sections subtree
$arSections = array();
$rsSections = CIBlockSection::GetList(
array(),
array(
"IBLOCK_ID" => $arParams["IBLOCK_ID"],
"LEFT_MARGIN" => $arResult["LEFT_MARGIN"],
"RIGHT_MARGIN" => $arResult["RIGHT_MARGIN"],
),
false,
array("ID", "DEPTH_LEVEL", "SECTION_PAGE_URL", "UF_TTX")
);
while($arSection = $rsSections->Fetch())
$arSections[$arSection["ID"]] = $arSection;
foreach ($arResult["ITEMS"] as $key => $arElement)
{
$this->__component->arResult["IDS"][] = $arElement["ID"];
if(is_array($arElement["OFFERS"]) && !empty($arElement["OFFERS"])){
foreach($arElement["OFFERS"] as $arOffer){
$this->__component->arResult["OFFERS_IDS"][] = $arOffer["ID"];
}
}
if(is_array($arElement["DETAIL_PICTURE"]))
{
$arFilter = '';
if($arParams["SHARPEN"] != 0)
{
$arFilter = array(array("name" => "sharpen", "precision" => $arParams["SHARPEN"]));
}
$arFileTmp = CFile::ResizeImageGet(
$arElement["DETAIL_PICTURE"],
array("width" => $arParams["DISPLAY_IMG_WIDTH"], "height" => $arParams["DISPLAY_IMG_HEIGHT"]),
BX_RESIZE_IMAGE_PROPORTIONAL,
true, $arFilter
);
$arResult["ITEMS"][$key]["PREVIEW_IMG"] = array(
"SRC" => $arFileTmp["src"],
'WIDTH' => $arFileTmp["width"],
'HEIGHT' => $arFileTmp["height"],
);
}
$section_id = $arElement["~IBLOCK_SECTION_ID"];
if(array_key_exists($section_id, $arSections))
{
$urlSection = str_r eplace(
array("#SECTION_ID#", "#SECTION_CODE#"),
array($arSections[$section_id]["ID"], $arSections[$section_id]["CODE"]),
$urlTemplate
);
$arResult["ITEMS"][$key]["DETAIL_PAGE_URL"] = CIBlock::Repl aceDetailUrl(
$urlSection,
$arElement,
true,
"E"
);
}
}
$this->__component->SetResultCacheKeys(array("IDS"));
$this->__component->SetResultCacheKeys(array("OFFERS_IDS"));
?>
|
указать
"SECTION_FIELDS" => Array("UF_*"),
Тогда в шаблоне появятся нужные свойства