Answer the question
In order to leave comments, you need to log in
How to adjust the filter by property in the Bitrix event calendar?
working example
$arFilter = Array("IBLOCK_ID"=>$IBLOCK_ID,"ACTIVE" => "Y", ">=DATE_ACTIVE_FROM" => $curdate, "PROPERTY" => array('ADD_TO_EVENTS' => array('VALUE' => 'Y')), "<=DATE_ACTIVE_FROM" => $curdatelast);
$arFilterDate = Array(
"IBLOCK_ID" => $IBLOCK_ID,
"ACTIVE" => "Y",
">=DATE_ACTIVE_FROM" => $curdate,
"PROPERTY" => array('DATA_SOBYTIYA' => array('VALUE' => true)),
"<=DATE_ACTIVE_FROM" => $curdatelast
);
$IBLOCK_ID = intval($arParams['IBLOCK_ID']);
//print $IBLOCK_ID;
if(!CModule::IncludeModule("iblock"))
die('iblock module is not included!');
$arSort = Array("SORT"=>"ASC", "NAME"=>"ASC");
$arSelect = Array("ID","NAME","PROPERTY_DATA_SOBYTIYA");
$arFilter = Array("IBLOCK_ID"=>$IBLOCK_ID,"ACTIVE" => "Y", ">=DATE_ACTIVE_FROM" => $curdate, "PROPERTY" => array('ADD_TO_EVENTS' => array('VALUE' => 'Y')), "<=DATE_ACTIVE_FROM" => $curdatelast);
$arFilterDate = Array(
"IBLOCK_ID" => $IBLOCK_ID,
"ACTIVE" => "Y",
">=DATE_ACTIVE_FROM" => $curdate,
"!PROPERTY" => array('DATA_SOBYTIYA' => array('VALUE' => false)),
"<=DATE_ACTIVE_FROM" => $curdatelast
);
$obIBlockResult = CIBlockElement::GetList($arSort, $arFilter, false, false, $arSelect);
$arFilter = $obIBlockResult->GetNext();
$sProperty = $arFilterDate;//["PROPERTY_DATA_SOBYTIYA_VALUE"];
...
$arDay["events"][] = array(
"time"=>$eTime,
"url"=>$dayNews["DETAIL_PAGE_URL"],
"title"=>$title,
"preview"=>$sTitle,
"property"=>$sProperty,//свойство должно что-то передавать
$arParams["DATE_FIELD"]=>$dayNews[$arParams["DATE_FIELD"]],
);
array(4) {
["day"]=>
int(18)
["td_class"]=>
string(14) "NewsCalWeekend"
["tday_class"]=>
string(10) "NewsCalDay"
["events"]=>
array(1) {
[0]=>
array(6) {
["time"]=>
string(11) "19:17 "
["url"]=>
string(56) "/adress/"
["title"]=>
string(92) "sadfsadfsadfds"
["preview"]=>
string(190) "выавфыаывфавыаываывфаывавыаывфавыа.."
["property"]=>
array(5) {
["IBLOCK_ID"]=>
int(31)
["ACTIVE"]=>
string(1) "Y"
[">=DATE_ACTIVE_FROM"]=>
NULL
["PROPERTY"]=>
array(1) {
["DATA_SOBYTIYA"]=>
array(1) {
["VALUE"]=>
bool(true)
}
}
["<=DATE_ACTIVE_FROM"]=>
NULL
}
["DATE_ACTIVE_FROM"]=>
string(19) "18.06.2016 19:17:00"
}
}
}
Answer the question
In order to leave comments, you need to log in
$arrFilter['!PROPERTY_<property code>'] = false;
check for completed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question