Подскажите пож-ста . Задача вывести в модальном окне детальные новости с несколькими картинками, чтобы можно было листать вправо/влево.
Для одной картинки сделал через детальную картинку, а вот для нескольких не получается!
Создали свойство в инф.блоке MORE_PHOTO , но картинки так и не выводятся, в веб программировании не особо силен (только начинаю), прошу помощи как решить проблему
Код в news.list
Шаблон template.php
Скрытый текст |
|---|
| Код |
|---|
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
/** @var array $arParams */
/** @var array $arResult */
/** @global CMain $APPLICATION */
/** @global CUser $USER */
/** @global CDatabase $DB */
/** @var CBitrixComponentTemplate $this */
/** @var string $templateName */
/** @var string $templateFile */
/** @var string $templateFolder */
/** @var string $componentPath */
/** @var CBitrixComponent $component */
$this->setFrameMode(true);
?><?if(count($arResult["ITEMS"])>0):?>
<?
$arCurView = $arViewStyles['TILE'];
foreach ($arResult["ITEMS"] as $arElement)
{
$this->AddEditAction($arElement['ID'], $arElement['EDIT_LINK'], CIBlock::GetArrayByID($arParams["IBLOCK_ID"], "ELEMENT_EDIT"));
$this->AddDeleteAction($arElement['ID'], $arElement['DELETE_LINK'], CIBlock::GetArrayByID($arParams["IBLOCK_ID"], "ELEMENT_DELETE"), array("CONFIRM" => GetMessage('CT_BCS_ELEMENT_DELETE_CONFIRM')));
?>
<div class="col-xs-12 col-sm-6 col-md-4" id="<? echo $this->GetEditAreaId($arElement['ID']); ?>">
<div class="stock-box">
<a href="<? echo $arElement['DETAIL_PAGE_URL']; ?>"
class="prev_picture open_window"
st yle="vertical-align: top; background-image:url('<? echo $arElement['PREVIEW_PICTURE']['SRC']; ?>');"
title="<? echo $arElement['PREVIEW_PICTURE']['TITLE']; ?>"></a>
<?if($arParams["DISPLAY_NAME"]!="N" && $arElement["NAME"]):?>
<a href="<?echo $arElement["DETAIL_PAGE_URL"]?>"><h3><?echo $arElement["NAME"]?></h3></a>
<?endif;?>
<?if($arParams["DISPLAY_DATE"]!="N" && $arElement["DISPLAY_ACTIVE_FROM"]):?>
<date><?echo $arElement["DISPLAY_ACTIVE_FROM"]?></date>
<?endif?>
<a href="<? echo $arElement['DETAIL_PAGE_URL']; ?>" class="open_window"></a>
<div class="popup_content">
<div class="row">
<div class="good_picture">
<? $db_props = CIBlockElement::GetProperty($arElement['ID'], 64, "sort", "asc", array());
/*Перечисляем все его свойства*/
while($ar_props = $db_props->Fetch()){
print($ar_props);?>
<?foreach($ar_props['VALUE'] as $value)
{
$props=CIBlockElement::GetProperty($arProperty['LINK_IBLOCK_ID'], $value,"sort", "asc", Array("CODE"=>"MORE_PHOTO"));
$pic_id=$props->fetch();
$pic=CFile::GetFileArray($pic_id['VALUE']);
echo'<img src="'.$pic['SRC'].'">';
echo $arProperty["DISPLAY_VALUE"];
}?>
<?}?>
<?$file=CFile::GetFileArray($arResult['news']['MORE_PHOTO']['VALUE']);
echo $file['SRC'];?>
</div>
<div class="good_desc">
<? echo $arElement['DETAIL_TEXT']; ?>
</div>
</div>
</div></div></div>
<?
}
?>
<?if($arParams["DISPLAY_BOTTOM_PAGER"]):?>
<div style="padding-left: 24px;" class="col-xs-12"><?=$arResult["NAV_STRING"]?></div>
<?endif;?>
<div class="overlay" title="окно"></div>
<div class="popup">
<div class="close_window"></div>
<div class="popup_contain"></div>
</div>
<sc ript type="text/javascript">
$('.popup .close_window, .overlay').click(function (){
$('.popup, .overlay').css({'opacity': 0, 'visibility': 'hidden'});
});
$('a.open_window').click(function (e){
$('.popup .popup_contain').html($(this).closest('.stock-box').find('.popup_content').html());
$('.popup, .overlay').css({'opacity': 1, 'visibility': 'visible'});
e.preventDefault();
});
</sc ript>
<?endif;?> |
|
в той же папке result_modifier.php
Скрытый текст |
|---|
| Код |
|---|
<?
$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;
}
}
?> |
|