Open derBoogie opened 3 years ago
I have implemented the archive view for testing purposes. This requires relatively little effort:
ext_localconf.php the plugin configuration has to be extended with a "listArchive" action.
DayController.php has to be extended with a "listArchiveAction":
/**
* @param Filter|null $filter
*/
public function listArchiveAction(?Filter $filter = null): void
{
$days = $this->dayRepository->findEvents('archive', $this->validateAndAssignFilter($filter));
$this->view->assign('days', $days);
CacheUtility::addPageCacheTagsByQuery($days->getQuery());
}
Switch/Case in DatabaseService.php, function addConstraintForDate has to be extended with:
case 'archive':
if ($this->extConf->getRecurringPast() === 0) {
// including current time - x months
$startDateTime = new \DateTime('now -12 months');
} else {
// including current time - x months
$startDateTime = new \DateTime('today -12 months');
}
$endDateTime = $dateTimeUtility->convert('today - 1 day');
$endDateTime->modify('23:59:59');
break;
switchableControllerActions in Confuiguration/FelxForms/Events.xml has to be extended with:
<numIndex index="5">
<numIndex index="0">LLL:EXT:events2/Resources/Private/Language/FlexForms.xlf:listArchive</numIndex>
<numIndex index="1"><![CDATA[Day->listArchive;Day->show;Day->showByTimestamp;Location->show;Video->show]]></numIndex>
</numIndex>
Create template .../Templates/Day/ListArchive.html and copy markup from List.html
FlexForms.xlf needs to be extended with:
<trans-unit id="listArchive">
<source>List archive events</source>
</trans-unit>
de.FlexForm.xlf has to be extended with:
<trans-unit id="listArchive">
<source>List archive events</source>
<target>Auflistung von Archiv-Terminen</target>
</trans-unit>
It would be great if this could be included in the next release!
Showing past events is not the idea of events2, but since years the type "range" is not fully implemented: https://github.com/jweiland-net/events2/blob/master/Classes/Domain/Repository/DayRepository.php#L334 Maybe that can be used to implement such a feature.
As I understood the documentation the extension setting recurringPast https://docs.typo3.org/p/jweiland/events2/main/en-us/Configuration/Extension/Index.html#recurringpast will show past events in the frontend or am I wrong?
@maslme This setting will only configure the past X month a day record will be calculated for each event. Events without a calculated day record will not be shown in frontend. Of cause, you can set this value to f.e. 328, but such huge values will cost a lot of time and power to calculate all these day records. It can result in a lot of day records, which may slow down your complete events2 system.
A spimle archive list view (without recurring events) would be great!