[TYPO3-english] How to extend tt_conent field in plugin backend module + TYPO3 6.2
Anupam Chatterjee
anupam at vrisini.com
Sun Aug 24 07:05:28 CEST 2014
On 8/22/2014 7:39 PM, Jainish Senjaliya wrote:
> Hello Sir,
>
> I am trying to extend tt_content field in plugin. but its not working.
>
> i am using following code in ext_table.php
>
> = = = = = = = = = = = CODE BEGIN - EXT BASE = = = = = = = = = = =
>
> $tempColumns = array(
> 'tx_damdownloadlist_records' => array(
> 'exclude' => 0,
> 'label' => 'title2',
> 'config' => array(
> 'type' => 'input'
> )
> )
> );
>
You need to add this line:
\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
> \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $tempColumns, 1);
You do not need the third parameter, it is already depricated
> \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('tt_content', 'tx_damdownloadlist_records;;;;1-1-1');
This should already display your field for all Content Types. You should
not need the next two lines if the objective is to just display the
field in the form.
The following two lines are required when you want to add your field to
specific plugin element and not to all CTypes. If you are using the
following two lines, then you can also skip the above line.
> $TCA["tt_content"]["types"]["list"]["subtypes_excludelist"]["FileList"]="layout,select_key,pages";
> $TCA["tt_content"]["types"]["list"]["subtypes_addlist"]["FileList"]="tx_damdownloadlist_records;;;;1-1-1";
"FileList" is wrong here. If your extension key is "Abc" and your plugin
key is "Xyz", then the index is "abc_xyz", all in small.
Do not forget to clear cache!!
Best regards,
Anupam Chatterjee
More information about the TYPO3-english
mailing list