I have a working Extbase extension, that displays a form to the frontend, depending on what options are chosen in the backend whilst putting it on a page.
I use a Flexform for these options (mainly the form action, but also some fields).
Everything works fine, except for the constants. Because this form template might be changed for different websites it is used on, i want to be able to change the template rootpath, so I can define custom templates.
I have a constants.txt and a setup.txt in form_plugin/Configuration/TypoScript
The constants look like this:
plugin.tx_nlmymail_newsletter {
view {
# cat=plugin.tx_nlmymail_newsletter/file; type=string; label=Path to template root (FE)
templateRootPath = EXT:nl_mymail/Resources/Private/Templates/
# cat=plugin.tx_nlmymail_newsletter/file; type=string; label=Path to template partials (FE)
partialRootPath = EXT:nl_mymail/Resources/Private/Partials/
# cat=plugin.tx_nlmymail_newsletter/file; type=string; label=Path to template layouts (FE)
layoutRootPath = EXT:nl_mymail/Resources/Private/Layouts/
}
persistence {
# cat=plugin.tx_nlmymail_newsletter//a; type=string; label=Default storage PID
storagePid =
}
}
My setup.txt looks like this:
plugin.tx_nlmymail_newsletter {
view {
templateRootPaths.0 = {$plugin.tx_nlmymail_newsletter.view.templateRootPath}
partialRootPaths.0 = {$plugin.tx_nlmymail_newsletter.view.partialRootPath}
layoutRootPaths.0 = {$plugin.tx_nlmymail_newsletter.view.layoutRootPath}
}
persistence {
storagePid = {$plugin.tx_nlmymail_newsletter.persistence.storagePid}
}
}
So according to this, this should be sufficient. Maybe I'm missing a piece here.
In my ext_tables.php i use
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'mail connection');
To include the Typoscript.
Do I need to make a custom category for my constants?
I compared with the bootstrap_package Plugin, but I can't seem to find the crucial difference.
If someone could point me in the right direction, maybe a part of the documentation I'm missing, I'd be very grateful.
