I’m trying to add a button that allows users to subscribe to my event calender via a webcall:// link. I use type=9819
to trigger the function.
I can‘t get my icalAction to work, it just gets ignored and typo3 uses the listAction from the extension instead.
Im using typo3 13.4 and sitepackage. I would like to manage the output in a fluid template
My folder structure is:
/packages
└── studilife
├── Classes
│ └── Controller
│ └── EventController.php
├── Configuration
│ └── Sets
│ └── Studilife
│ └── TyposScript
│ └── setup.typoscript
├── Resources
│ └── Private
│ └── Extensions
│ └── SfEventMgt
│ └── Templates
│ └── Event
│ └── Ical.html
└── ext_localconf.php
This is my code so far:
ext_localconf.php:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][DERHANSENSfEventMgtControllerEventController::class] = [
'className' => StudentStudilifeControllerEventController::class,
];
TYPO3CMSExtbaseUtilityExtensionUtility::configurePlugin(
'SfEventMgt',
'Event',
[
DERHANSENSfEventMgtControllerEventController::class => 'list,detail,register,ical'
],
[]
);
setup.typoscript:
plugin.tx_sfeventmgt {
view {
templateRootPaths {
100 = EXT:studilife/Resources/Private/Extensions/SfEventMgt/Templates/
}
partialRootPaths {
100 = EXT:studilife/Resources/Private/Extensions/SfEventMgt/Partials/
}
layoutRootPaths {
100 = EXT:studilife/Resources/Private/Extensions/SfEventMgt/Layouts/
}
}
settings {
calendar{
showWeekNumber = 0
}
}
}
pageEventICalendar = PAGE
pageEventICalendar {
typeNum = 9819
settings.format = txt
config {
disableAllHeaderCode = 1
xhtml_cleaning = none
admPanel = 0
metaCharset = utf-8
locale_all = en_EN
additionalHeaders.10.header = Content-Type:text/calendar;charset=utf-8
disablePrefixComment = 1
linkVars >
}
10 = USER
10 {
userFunc = TYPO3CMSExtbaseCoreBootstrap->run
extensionName = SfEventMgt
pluginName = Event
vendorName = DERHANSEN
controller = Event
action = ical
}
}
eventController.php:
<?php
namespace StudentStudilifeController;
class EventController extends DERHANSENSfEventMgtControllerEventController
{
public function icalAction()
{
$events = $this->eventRepository->findAll();
$this->view->assign('events', $events);
$this->view->setFormat('txt');
header('Content-Type: text/calendar; charset=utf-8');
header('Content-Disposition: attachment; filename="events.ics"');
}
}
Im trying to get my Action to be recognized by typo3. The typoscript works fine so far, but the eventController.php
is just ignored. Its my first time trying to change the behaviour of an extension, so i probably miss something very basic. I tryed to use this official typo3 documentation: https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Xclasses/Index.html.
Thanks for your help