// bitrix/templates/innet_corp4_1_s1/components/bitrix/news/projects/bitrix/news.detail/result_modifer.php
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); ?>
<? if (!empty($arResult['PROPERTIES']['MORE_PHOTO']['VALUE'])) {
foreach ($arResult['PROPERTIES']['MORE_PHOTO']['VALUE'] as $val) {
$arPic[] = array(
'RESIZE_SRC' => CFile::ResizeImageGet($val, array("width" => 215, "height" => 178), BX_RESIZE_IMAGE_EXACT, true),
'SRC' => CFile::GetPath($val)
);
}
}
$arResult['IMAGES_SLIDER'] = $arPic;
?>
// bitrix/templates/innet_corp4_1_s1/components/bitrix/news/projects/bitrix/news.detail/template.php
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<?$this->setFrameMode(true);?>
<?foreach ($arResult['IMAGES_SLIDER'] as $slide){?>
<a data-fancybox="projects" href="<?=$slide['SRC']?>">
<img src="<?=$slide['RESIZE_SRC']['src']?>" alt="<?=$arResult['NAME']?>" />
</a>
<?}?>
На страницу с детальным описанием проектов фотографии выводятся следующим образом:
// bitrix/templates/innet_corp4_1_s1/components/bitrix/news/projects/detail.php
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); ?>
<?$this->setFrameMode(true);?>
<?$APPLICATION->IncludeComponent(
"bitrix:news.detail",
"",
Array(
"DISPLAY_DATE" => $arParams["DISPLAY_DATE"],
"DISPLAY_NAME" => $arParams["DISPLAY_NAME"],
"DISPLAY_PICTURE" => $arParams["DISPLAY_PICTURE"],
"DISPLAY_PREVIEW_TEXT" => $arParams["DISPLAY_PREVIEW_TEXT"],
"IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
"IBLOCK_ID" => $arParams["IBLOCK_ID"],
"FIELD_CODE" => $arParams["DETAIL_FIELD_CODE"],
"PROPERTY_CODE" => $arParams["DETAIL_PROPERTY_CODE"],
"DETAIL_URL" => $arResult["FOLDER"] . $arResult["URL_TEMPLATES"]["detail"],
"SECTION_URL" => $arResult["FOLDER"] . $arResult["URL_TEMPLATES"]["section"],
"META_KEYWORDS" => $arParams["META_KEYWORDS"],
"META_DESCRIPTION" => $arParams["META_DESCRIPTION"],
"BROWSER_TITLE" => $arParams["BROWSER_TITLE"],
"DISPLAY_PANEL" => $arParams["DISPLAY_PANEL"],
"SET_TITLE" => $arParams["SET_TITLE"],
"SET_STATUS_404" => $arParams["SET_STATUS_404"],
"INCLUDE_IBLOCK_INTO_CHAIN" => $arParams["INCLUDE_IBLOCK_INTO_CHAIN"],
"ADD_SECTIONS_CHAIN" => $arParams["ADD_SECTIONS_CHAIN"],
"ACTIVE_DATE_FORMAT" => $arParams["DETAIL_ACTIVE_DATE_FORMAT"],
"CACHE_TYPE" => $arParams["CACHE_TYPE"],
"CACHE_TIME" => $arParams["CACHE_TIME"],
"CACHE_GROUPS" => $arParams["CACHE_GROUPS"],
"USE_PERMISSIONS" => $arParams["USE_PERMISSIONS"],
"GROUP_PERMISSIONS" => $arParams["GROUP_PERMISSIONS"],
"DISPLAY_TOP_PAGER" => $arParams["DETAIL_DISPLAY_TOP_PAGER"],
"DISPLAY_BOTTOM_PAGER" => $arParams["DETAIL_DISPLAY_BOTTOM_PAGER"],
"PAGER_TITLE" => $arParams["DETAIL_PAGER_TITLE"],
"PAGER_SHOW_ALWAYS" => "N",
"PAGER_TEMPLATE" => $arParams["DETAIL_PAGER_TEMPLATE"],
"PAGER_SHOW_ALL" => $arParams["DETAIL_PAGER_SHOW_ALL"],
"CHECK_DATES" => $arParams["CHECK_DATES"],
"ELEMENT_ID" => $arResult["VARIABLES"]["ELEMENT_ID"],
"ELEMENT_CODE" => $arResult["VARIABLES"]["ELEMENT_CODE"],
"IBLOCK_URL" => $arResult["FOLDER"] . $arResult["URL_TEMPLATES"]["news"],
"USE_SHARE" => $arParams["USE_SHARE"],
"SHARE_HIDE" => $arParams["SHARE_HIDE"],
"SHARE_TEMPLATE" => $arParams["SHARE_TEMPLATE"],
"SHARE_HANDLERS" => $arParams["SHARE_HANDLERS"],
"SHARE_SHORTEN_URL_LOGIN" => $arParams["SHARE_SHORTEN_URL_LOGIN"],
"SHARE_SHORTEN_URL_KEY" => $arParams["SHARE_SHORTEN_URL_KEY"],
"INNET_ALLOW_REVIEWS" => $arParams["INNET_ALLOW_REVIEWS"],
"INNET_IBLOCK_ID_ORDER" => $arParams["INNET_IBLOCK_ID_ORDER"],
"INNET_IBLOCK_ID_REVIEWS" => $arParams["INNET_IBLOCK_ID_REVIEWS"],
"INNET_IBLOCK_ID_SERVICES" => $arParams["INNET_IBLOCK_ID_SERVICES"],
),
$component
);?>
Как вывести эти же фотографии еще и в секции на главной со списком проектов?
// bitrix/templates/innet_corp4_1_s1/components/bitrix/news_list/projects/template.php
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<?$this->setFrameMode(true);?>
<div class="projects__swiper swiper">
<div class="projects__list swiper-wrapper">
<?foreach ($arResult['ITEMS'] as $arItem){?>
<?$pic = CFile::ResizeImageGet($arItem['PREVIEW_PICTURE']['ID'], array("width" => 800, "height" => 875), BX_RESIZE_IMAGE_PROPORTIONAL, true);?>
<div class="swiper-slide projects__item item-projects">
<img width="446" height="488" class="item-projects__image" src="<?=$pic['src']?>" alt="<?=$arItem['NAME']?>">
<a href="#" data-fancybox-trigger="projects" class="item-projects__link">
<div class="item-projects__content icon icon-search">
<h3 class="item-projects__title"><?=$arItem['NAME']?></h3>
<p class="item-projects__text"><?=TruncateText($arItem['PREVIEW_TEXT'], 150)?></p>
</div>
</a>
<div class="item-projects__slider">ТУТ ДОЛЖНЫ БЫТЬ ФОТО КАЖДОГО ПРОЕКТА</div>
</div>
<?}?>
</div>
</div>