Reputation: 1309
I develop TYPO3 extension. And I have file ext_conf_templates with my settings. How do I use this settings in the typoscript, root.ts ?
# cat=Template_einstellung/101/0104; type=options[nein=,ja=noborder]; label=remove bottom border (only with transparent use)
template.border =
Upvotes: 0
Views: 190
Reputation: 585
In your ext_localconf.php
add below code.
$conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY]);
$border = $conf['template.']['border'];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants("
plugin.tx_yourextensionkey.template.border = $border
");
Now, anywhere in your typoscript setup you can access your border variable with {$plugin.tx_yourextensionkey.template.border}. You can name this variable as you like but best practice is to use plugin and extension name prefix to make it unique across installations.
Above works for TYPO3 CMS version 8.7. I think it´s the same routine all the way down to version 6.2 but I´m not 100% sure.
You can verify that this works with the Template
backend module. In the main select box select TypoScript Object Browser
. Make sure that the browser select box says Constants
. Now you should be able to find your new variable.
Upvotes: 2