Reputation: 8020
I'm developing on 7.6 currently. I have made a few minor plugins that need to have their templates overridden for different pages, but I cant get TYPO3 to do this.
I have added static file include in sys_template.php
:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
'my_contacts',
'Configuration/TypoScript',
'Main Template'
);
that contains setup.txt
and constants.txt
:
As you can see, I also added it in static.
setup.txt
plugin.my_contacts {
view {
templateRootPaths {
0 = EXT:my_contacts/Resources/Private/Templates/
1 = {$plugin.my_contacts.view.templateRootPath}
}
partialRootPaths {
0 = EXT:my_contacts/Resources/Private/Partials/
1 = {$plugin.my_contacts.view.partialRootPath}
}
layoutRootPaths {
0 = EXT:my_contacts/Resources/Private/Layouts/
1 = {$plugin.my_contacts.view.layoutRootPath}
}
}
settings {
cssFile = {$plugin.my_contacts.settings.cssFile}
}
}
constants.txt
plugin.my_contacts {
view {
# cat=plugin.my_contacts/file; type=string; label=Path to template root (FE)
templateRootPath = EXT:my_contacts/Resources/Private/Templates/
# cat=plugin.my_contacts/file; type=string; label=Path to template partials (FE)
partialRootPath = EXT:my_contacts/Resources/Private/Partials/
# cat=plugin.my_contacts/file; type=string; label=Path to template layouts (FE)
layoutRootPath = EXT:my_contacts/Resources/Private/Layouts/
}
settings {
# cat=plugin.my_contacts/file; type=string; label=Path to CSS file
cssFile = EXT:my_contacts/Resources/Public/Css/news-basic.css
}
}
The contents used to be simple, but at this stage, I have them copied from news
plugin, so it has now more settings, but I dont see those entries when I check the Template Analyzer or try to access settings in vew/controller. Also, when I try to override the template paths in a template content in a page, nothing happens there either.
The plugin Templates themselves are recognized and read, I just cant get them to be overridden (or read settings from setup).
I read lots of examples but cant find what I'm missing, so any hint is apreciated.
PS: Also, I have cleared all system caches and autoload information, just in case. Didnt help.
Upvotes: 0
Views: 1738
Reputation: 2685
For now you have just registered the static Typoscripts for usage in Typoscript Templates. Please select your Typoscript Template using the "Template" module in the backend and go to "Edit whole Template record". On "Includes" you now see all extension that have registered static Typoscript like your extension and include them to your current Template. (see Screenshots below).
Upvotes: 3
Reputation: 6144
Did you include the static template in your TypoScript template?
Upvotes: 1