[Typo3-dev] Frontend Plugin Customisation

Christian Jul Jensen christian at jul.net
Thu Aug 26 14:24:41 CEST 2004


John Begley <John.Begley at hummingbird.com> writes:

> I see on Kaspers CD Collection video that he adds a field to the tt_content
> table in order for the user to select type of CDs to list - but if I add a
> field here it appears for all content elements.
> 
> I'm probably missing something fundamental here, but basically I want to
> allow custom configuration for an individual plugin.

This is the "ol'school" way to handle it. It's depreciated, but
suppported by the kickstarter:

in your ext_tables.php file you should find something similar to this:

t3lib_div::loadTCA("tt_content");
t3lib_extMgm::addTCAcolumns("tt_content",$tempColumns,1);
t3lib_extMgm::addToAllTCAtypes("tt_content","tx_julleevents_type;;;;1-1-1");

What it does is,
1: Make sure all information about the TCA for tt_content is loaded
2: Add the columns defined previously in $tempColumns to the TCA
3: Adds the field(s) to all content types.

Outcomment / remove the last line, and add something like this:

$TCA["tt_content"]["types"]["list"]["subtypes_excludelist"][$_EXTKEY."_pi1"]="layout,select_key";
$TCA["tt_content"]["types"]["list"]["subtypes_addlist"][$_EXTKEY."_pi1"]="tx_julleevents_type;;;;1-1-1, tx_julleevents_category, tx_julleevents_city, tx_julleevents_dontshow";


The first line might be there already, I can't remember.


The new and right way to do it would be to add your fields as a T3DataStructure to
the field pi_flexform, like this:

$TCA["tt_content"]["types"]["list"]["subtypes_excludelist"][$_EXTKEY."_pi2"]="layout,select_key,pages";
$TCA['tt_content']['types']['list']['subtypes_addlist'][$_EXTKEY.'_pi2']='pi_flexform';
t3lib_extMgm::addPiFlexFormValue($_EXTKEY.'_pi2', 'FILE:EXT:dmaqs/pi2/flexform_ds.xml');

This way your extension doesn't add more fields to the tt_content
table. Make sure to clean up the ext_tables.sql file as well.

See more about T3DataStructure here:
http://typo3.org/documentation/document-library/doc_core_api/Introduction-719a9560ef/


--
Julle




More information about the TYPO3-dev mailing list