Cast Iron Coding, Inc

TYPO3 Admin's Corner

Click here to return to the TYPO3 Admin's Corner

Stay Connected

Complete the form below to sign up for the CIC newsletter. We send out about one message each month and we do our best to make sure it's full of useful information about TYPO3. We'll never share your email address with a third-party and should you ever change your mind, unsubscribing is a breeze.
Configuring TYPO3

Modifying the TCA

By: Zach Davis


2. Create an ext_tables.php file


Just about every TYPO3 extension contains a ext_tables.php file. TYPO3 will load the ext_tables.php file for each extension at runtime and add the configuration to the global TYPO3 configuration arrays. Our plan is to store our TCA modifications in this the ext_tables.php file in our custom extension directory. We could have also made our changes in typo3conf/localconf.php (the configuration file that stores values from the install tool, among other things), but I generally recommend that one stores the info an extension so that it's portable from one TYPO3 installation to another. This way, if you want to copy the same customizations over to another site, you can just copy the extension rather than digging around in localconf.php.

So, go ahead and create a file called ext_tables.php in the directory of your next extension using the command line, and FTP client, or whatever method you're most comfortable with. In my case, I installed the extension locally and the key was cic_tcamod, so my extension directory will be located at /typo3conf/ext/cic_tcamod. Creating ext_tables.php
All right -- now that we have the ext_tables.php file in place, let's go ahead and start setting up our custom configuration.


3. Setting up ext_tables.php

Open ext_tables.php in your favorite text editor and add the following code to it: Setting up ext_tables.php Obviously, the first and last line are the open and close tags for PHP. The "if" statement in the prevents the file from being opened directly, since it will die unless it is executed from within the TYPO3 backend. We still haven't done anything very exciting at this point -- but hold on to your hats, cowboys and cowgirls, the real action is coming up.

The next step is to load the TCA so that we can modify it. To load the TCA, update your ext_tables.php file so that it looks like this: Loading the TCA That's it as far as setting up the ext_tables.php file is concerned. Now we're ready to begin modifying the TCA.

Posted on Thursday, September 01, 2005 at 08:33 AM.