Core API
2.1.2. Files and locations
Files
An extension consists of
-
a directory named by the extension key (which is a worldwide unique identification string for the extension unless prefix with "user_")
-
standard files with reserved names for configuration related to TYPO3 (of which most are optional, see list below)
-
any number of additional files for the extension itself.
Reserved filenames
This list of filenames are all reserved filenames in the root directory of extensions. None of them are required but for example you cannot have a TYPO3 extension recognized by TYPO3 without the "ext_emconf.php" file etc. You can read more details like that in the table below.
In general, do not introduce your own files in root directory of extensions with the name prefix "ext_".
|
Filename |
Description |
|---|---|
|
ext_emconf.php |
Definition of extension properties
Name, category, status etc. Used by the EM. Also auto-written by EM when extensions are imported from repository.
Notice: If this file is not present the EM will not find the extension. |
|
ext_localconf.php |
Addition to "localconf.php" which is included if found. Should contain additional configuration of $TYPO3_CONF_VARS and may include additional PHP class files. All 'ext_localconf.php' files of included extensions are included right after the typo3conf/localconf.php file has been included and database constants defined. Therefore you cannot setup database name, username, password though, because database constants are defined already at this point.
|
|
ext_tables.php |
Addition to "tables.php" which is included if found. Should contain configuration of tables, modules, backend styles etc. Everything which can be done in an "extTables" file is allowed here.
You should not use this file for setting up $TYPO3_CONF_VARS. See "ext_localconf.php".
|
|
ext_tables.sql |
SQL definition of database tables.
|
|
ext_tables_static+adt.sql |
Static SQL tables and their data.
You can also drop the table content using the EM in the backend.
Notice: The table structure of static tables needs to be in the ext_tables.sql file as well - otherwise an installed static table will be reported as being in excess in the EM! |
|
ext_typoscript_constants.txt |
Preset TypoScript constants
Deprecated (use static template files instead, see extMgm API description) Such a file will be included in the constants section of all TypoScript templates. |
|
ext_typoscript_setup.txt |
Preset TypoScript setup Deprecated (use static template files instead, see extMgm API description)
|
|
ext_typoscript_editorcfg.txt |
Preset TypoScript editor configuration Deprecated (use static template files instead, see extMgm API description)
|
|
ext_conf_template.txt |
Extension Configuration template.
Configuration code in TypoScript syntax setting up a series of values which can be configured for the extension in the EM.
The content of the "res/" folder is used for filelists in configuration forms.
If you want to do user processing before the content from the configuration form is saved (or shown for that sake) there is a hook in the EM which is configurable with $TYPO3_CONF_VARS['SC_OPTIONS']['typo3/mod/tools/em/index.php']['tsStyleConfigForm'][] = "function reference" |
|
ext_icon.gif |
Extension Icon
18x16 gif icon for the extension. |
|
(*/) locallang*.php |
Localization values.
The filename "locallang.php" (or any file matching locallang*.php) is used for traditional definition of language labels in the $LOCAL_LANG array. If you use this name consistently those files will be detected by the translation tool!
Notice: PLEASE DO ONLY put the definition of the variable $LOCAL_LANG into this file and don't rely on comments in the file. The file will be automatically updated by the extension repository when translations are applied. |
|
class.ext_update.php |
Local Update tool class
Also you must add the function "access()" and make it return a boolean value whether or not the menu item should be shown. This feature is meant to let you disable the update tool if you can somehow detect that it has already been run and doesn't need to run again. |
|
ext_api_php.dat |
PHP API data
|
|
pi*/ |
Typical folder for a frontend plugin class. |
|
mod*/ |
Typical folder for a backend module. |
|
res/ |
Extensions normally consist of other files: Classes, images, html-files etc. Files not related to either a frontend plugin (pi/) or backend module (mod/) might be put in a subfolder of the extension directory named "res/" (for "resources") but you can do it as you like (inside of the extension directory that is).
Files in this folder can also be selected in a selector box if you set up Extension configuration in a "ext_conf_template.txt" file. |