<?
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
global $APPLICATION;
$aMenuLinksExt = array();
if(CModule::IncludeModule('iblock')) {
$arSelect = Array("ID", "NAME", "PROPERTY_*");
$arFilter = Array("IBLOCK_ID"=>ID вашего инфо, "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y");
$res = CIBlockElement::GetList(Array(), $arFilter, false, false, $arSelect);
while($ob = $res->GetNextElement()) {
$arFields = $ob->GetFields();
$aMenuLinksExt[] = Array(
$arFields["PROPERTY_"],
Array(),
Array(),
""
);
}
}
$aMenuLinks = array_merge($aMenuLinks, $aMenuLinksExt);
?>
<button onclick='test(<?=$arResult["ID"]?>)'></button> - это Ваша кнопка
function test(id){
$("input[name=element]").val(id);
}
jQuery(document).ready(function() {
if (jQuery.cookie('less') != "Y" ){ //убираем Null здесь
jQuery.cookie('less,'Y', {
path: '/',
});
jQuery.fancybox.open({
padding : [0, 0, 50, 0],
helpers: {
overlay: {
locked: false
}
},
wrapCSS : "read--less",
href: "#read--less"
});
}
jQuery('.popul_button').click(function () {
jQuery(this).find('input').prop('checked', true); //нашли верный input И работаем
jQuery(this).parents('form').submit();
});
$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>