[TYPO3-english] Extending tca from other extension

Michel Georgy michel at 4eyes.ch
Tue May 10 10:53:34 CEST 2011


Hi Dawid, 

Step 1) Add these lines to your extensions ext_tables.sql: (change type etc. to your needs)

> CREATE TABLE other_extensions_tablename (
> 	your_new_field int(11) DEFAULT '0' NOT NULL,
> );


Step 2) Change following lines to your needs and add it to your extensions ext_tables.php  :

> t3lib_div::loadTCA('other_extension_key');
> $tempColumns = array(
> 	'your_new_field' => array(
> 		'exclude' => 1,
> 		'label'   => 'LLL:EXT:your_extension_key/Resources/Private/Language/locallang_db.xml:your_extension_key.your_new_field',
> 		'config' => array(
> 			'type' => 'input',
> 			'size' => 30,
> 			'default' => '0'
> 		)
> 	)
> );
> t3lib_extMgm::addTCAcolumns('other_extendion_key', $tempColumns, 1);
> t3lib_extMgm::addToAllTCAtypes('other_extension_key', 'your_new_field');
> $TCA['other_extension_key']['ctrl']['type'] = 'your_new_field';


Step 3) Add the label to your extensions language file:  e.g. :  In File: typo3conf/your_extension_key/Resources/Private/Language/locallang_db.xml
> <label index="your_extension_key.your_new_field">Your_new_fields_label</label>



Step 4) If your extension is not already installed the field will be added once you install your extension. 
If your extension is already installed you have to do a Database compare in the install tool, or you click on your extension in the extension manager and 
do the suggested database update.


Greets 
Michel 

--

4eyes GmbH, Internetagentur

On May 10, 2011, at 9:00 AM, Dawid Pacholczyk wrote:

> Hello,
> I would like to create an extension that adds a field to other extension tca. How can i do that ?
> 
> Best regards,
> Dawid Pacholczyk
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english



More information about the TYPO3-english mailing list