[TYPO3-dev] Display a plug-in's field in the content element form
Francois Suter
fsuter at cobweb.ch
Fri Sep 1 11:04:06 CEST 2006
Hi all,
I am trying to get my extension's field to be displayed when
creating/modifying a content element in the BE.
Here's the beginning of the code, as generated by the Kickstarter (just
a small modification on line 2, to exclude 2 more fields):
t3lib_div::loadTCA('tt_content');
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY.'_pi1']='layout,select_key,pages,recursive';
$TCA['tt_content']['types']['list']['subtypes_addlist'][$_EXTKEY.'_pi1']='';
t3lib_extMgm::addPlugin(array('LLL:EXT:myext/locallang_db.xml:tt_content.list_type_pi1',
$_EXTKEY.'_pi1'),'list_type');
t3lib_extMgm::addStaticFile($_EXTKEY,"pi1/static/","Cash Machine");
if (TYPO3_MODE=="BE")
$TBE_MODULES_EXT["xMOD_db_new_content_el"]["addElClasses"]["tx_myext_pi1_wizicon"]
= t3lib_extMgm::extPath($_EXTKEY).'pi1/class.tx_myext_pi1_wizicon.php';
$tempColumns = Array (
"tx_myext_confirmation_page" => Array (
"exclude" => 1,
"label" =>
"LLL:EXT:myext/locallang_db.xml:tt_content.tx_myext_confirmation_page",
"config" => Array (
"type" => "group",
"internal_type" => "db",
"allowed" => "pages",
"size" => 1,
"minitems" => 0,
"maxitems" => 1,
)
),
);
t3lib_div::loadTCA('tt_content');
Now here comes the inclusion code. If I use this:
t3lib_extMgm::addToAllTCAtypes("tt_content","tx_myext_confirmation_page;;;;1-1-1");
the field gets added to all content elements, which is not what I want.
I tried to limit that by filling the type argument but it doesn't work:
t3lib_extMgm::addToAllTCAtypes("tt_content","tx_myext_confirmation_page;;;;1-1-1",$_EXTKEY.'_pi1');
I found the reason why by checking inside
t3lib_extMgm::addToAllTCAtypes() the list of types that were checked,
and it is only the page types and content element types. Not the plugin
types.
Looking at other extensions, I tried this:
$TCA['tt_content']['types'][$_EXTKEY.'_pi1']['showitem'] =
"tx_myext_confirmation_page;;;;1-1-1";
but it didn't help. Then I selected the "Apply a set of extended fields"
in the Kickstarter and told it to add the field to tt_content, and it
changed the line to that:
t3lib_extMgm::addTCAcolumns("tt_content",$tempColumns,1);
but still no luck.
I'm at my wits' end. Can anyone help?
Thanks in advance
--
Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch
More information about the TYPO3-dev
mailing list