Answer the question
In order to leave comments, you need to log in
How to finish adding your own parameter to the Bitrix component?
All this is necessary in order to link news with the event calendar, I poke the date of the month and the news feed at the bottom.
The problem is that the default cannot be set. it is set by the infoblock itself.
https://dev.1c-bitrix.ru/learning/course/?COURSE_I...
was
now
Event date(DATA_SOBYTIYA) this property I display the property
in the component
//вывожу дату
$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");
$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();
$sDateEventsCustom = "12.09.2016";//$arFilterDate["PROPERTY_DATA_SOBYTIYA_VALUE"]
$arDay["events"][] = array(
"time"=>$eTime,
"url"=>$dayNews["DETAIL_PAGE_URL"],
"title"=>$title,
"preview"=>$sTitle,
"DATA_SOBYTIYA"=>$sDateEventsCustom,//свойство должно что-то передавать
//"property"=>$sProperty,//свойство должно что-то передавать
$arParams["DATE_FIELD"]=>$dayNews[$arParams["DATE_FIELD"]],
);
array(1) {
[0]=>
array(5) {
["time"]=>
string(11) "19:17 "
["url"]=>
string(56) "/dsaf/asfdfa/"
["title"]=>
string(92) "авывыфавы"
["DATA_SOBYTIYA"]=>
string(190) "выаыфва.."
["DATE_ACTIVE_FROM"]=>
string(19) "18.06.2016 19:17:00"
}
}
$arDATE_FIELD = Array(
"DATE_ACTIVE_FROM" => "[DATE_ACTIVE_FROM] ".GetMessage("T_IBLOCK_DESC_CAL_DATE_ACTIVE_FROM"),
"DATE_ACTIVE_TO" => "[DATE_ACTIVE_TO] ".GetMessage("T_IBLOCK_DESC_CAL_DATE_ACTIVE_TO"),
"TIMESTAMP_X" => "[TIMESTAMP_X] ".GetMessage("T_IBLOCK_DESC_CAL_TIMESTAMP_X"),
"DATE_CREATE" => "[DATE_CREATE] ".GetMessage("T_IBLOCK_DESC_CAL_DATE_CREATE"),
"DATA_SOBYTIYA" => "[DATA_SOBYTIYA] ".GetMessage("T_IBLOCK_DESC_DATA_SOBYTIYA"),
);
<?
//здесь я пропарсил url на основе его выводится текущая дата
?>
<?foreach($arResult["MONTH"] as $arWeek):?>
<tr>
<?foreach($arWeek as $arDay):?>
<td class='calendar-date'>
<? $fulldatecal = $arDay["day"].".".$currentMonth.".".$currentYear;//дата дней в календаре?>
<?echo "<pre style='font-size:0'>"; var_dump($arDay["events"]);echo "</pre>";?>
<?echo "<p style='font-size:0'>".$arDay["events"][0]["DATA_SOBYTIYA"]."</p>";?>
<?echo "<p style='font-size:0'>".count($arDay["events"][0]["DATA_SOBYTIYA"])."</p>";?>
<?if(count($arDay["events"])>0):?>
<a title="<?=$arDay["events"][0]["title"]?>"
href="/calendar/<?=$arResult["currentYear"]?>/<?=$arResult["currentMonth"]?>/<?=$arDay["day"]?>/"
name="<?=$arDay["events"][0]["DATA_SOBYTIYA"]?>"
class="event-link"><?=$arDay["day"]?></a>
<?//}?>
<?else:?>
<span name="<?=$arDay["events"][0]["DATA_SOBYTIYA"]?>" title="<?=$fulldatecal?>"><?=$arDay["day"]?></span>
<?endif;?>
</td>
<?endforeach?>
</tr >
<?endforeach?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question