Feature #86735
closedMake \TYPO3\CMS\Core\Configuration\ExtensionConfiguration function get static
0%
Description
Is it possible to make the public function get() a static function ?
That way, we can do this in Typoscript:
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:my_ext/Configuration/TypoScript/Extension/news.typoscript" condition="userFunc = TYPO3\\CMS\\Core\\Configuration\\ExtensionConfiguration::get('my_ext', 'loadNewsTyposcriptPreset')">
For information, this is working BUT raise an error log get is not static
And yes, i could do
condition="userFunc = TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::isLoaded('news')"
but that's not the same as what i'm looking to achieve.
Updated by Georg Ringer about 6 years ago
- Status changed from New to Needs Feedback
What do you want to achieve? In your site setup you should already know if you are using a certain extension, or do I understand that wrong?
Updated by Sebastien Convers about 6 years ago
Ok, i'll try to explain my need :)
So, i have an extension that i use to preset/configure automatically other extensions.
- if i have news, i want to load some TSconfig, configure rss, overriding some templates
- if have indexed_search or felogin, i'm overriding the template
- and so on...
I insist on "automatically": the final user (me or coworkers) don't have to manually load multiples Typoscript templates according to his needs, only one from my extension.
Until now, ExtensionManagementUtility::isLoaded('any_ext') was good enough to use in my ext_localconf.php or in my typoscript files.
But what if one of my coworkers want my extension with all the preset for indexed_search, but not for news ? He will have to override all the things i have overrided. I would like him to go into the settings module, uncheck the box "load news configuration", and the TSconfig and typoscript for news won't be loaded, even though news IS loaded.
Maybe i want to go too far, and manually include one typoscript file for each extension preset will indeed achieve the same goal? Now that i'm writing it, go in the Settings module to check/uncheck a checkbox, or go into the Template module to include/remove a template, is pretty much the same...
But i'm already using the ExtensionConfiguration class in ext_localconf.php, and thought it would be nice to use it also in Typoscript condition.
I think i could also use ExtensionManagementUtility::addTypoScriptConstants in combination with ExtensionConfiguration->get() in my ext_localconf.php, but this is an extra step, compared to what it could be.
Anyway, i think there is many cases that can improve if there is a way to retrieve directly an ExtensionConfiguration parameter in Typoscript, don't you agree ? :-)
I still have to learn many things so if i was clear enough expressing my needs and you see that i get complicated for nothing, and miss a really simple solution, please tell me ^^
Updated by Georg Ringer over 4 years ago
- Status changed from Needs Feedback to Rejected
Thanks for your explanation.
This would mean a breaking change which we would highly like to avoid. Therefore I am closing the issue.
As suggestion I propose to have a helper method in your codebase which acts as wrapper.