Search code examples
phptypo3typo3-8.xtypo3-extensions

Typo3 is ext_tables.php still relevant in v8+?


I'm a Typoscript newbie and currently following tutorials to develop extensions. The documentation seems a little outdated so I#m muddled up in a few places, specifically:

--ext_tables.php

--configuration/TCA/Overrides/tt_content.php

--configuration/TCA/Overrides/sys_template.php

...from what I can tell most of the ext_tables.php code now resides in the configuration/TCA/Overrides/tt_content.php file (eg. the ::registerPlugin call). But where do the "::addStaticFile" calls now reside? Some say ext_tables.php, others say configuration/TCA/Overrides/sys_template.php ??

Do you think they will eventually deprecate ext_tables.php?

The T3 documentation site could do with updating the examples as and when things change. Very confusing for newbies.

thanks all


Solution

  • Gradually, the root of an extension folder will be cleaned up. Besides the TCA Override feature and the deprecation Riccardo showed you, TYPO3 v9 also simplified the database table creation, see https://docs.typo3.org/typo3cms/extensions/core/latest/Changelog/9.3/Feature-85160-AutoCreateManagementDBFieldsFromTCACtrl.html.

    When it comes to the registration of your static TypoScript files just check other core extensions how they handle it. See for example the form framework: https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/form/Configuration/TCA/Overrides/sys_template.php. This is best practise nowadays. Furtermore, use .typoscript as file extension, see https://docs.typo3.org/typo3cms/extensions/core/8.7/Changelog/8.7.x/Feature-78161-IntroduceTypoScriptFileExtension.html. In addition, .tsconfig shall be used for UserTS and PageTS, see https://docs.typo3.org/typo3cms/extensions/core/8.7/Changelog/8.5/Breaking-78384-FrontendIgnoresTCAInExtTables.html.