[TYPO3-english] Userfunction for foreign table labels in TCA

Lars Haendler typo3 at larshaendler.com
Fri Oct 31 10:25:29 CET 2008


Hi,

I have an extension with two tables. One table is category and one is 
product. As I liked the title label from category in an special way, I 
added to ext_tables.php a userlabel like this:

require_once(t3lib_extMgm::extPath($_EXTKEY).'class.userLabelClass.php');
$TCA['tx_apxkursdb_category']['ctrl']['label_userFunc'] = 
"user_LabelClass->getCategoryTitle";



But this function will only be used when I work directly in category. As 
soon as I use category in my product like this:

		"category" => Array (		
			"exclude" => 1,		
			"label" => 
"LLL:EXT:apxkursdb/locallang_db.xml:tx_apxkursdb_kurs.category",		
			"config" => Array (
				"type" => "select",	
				"foreign_table" => "tx_apxkursdb_category",	
				"foreign_table_where" => "ORDER BY tx_apxkursdb_category.sorting",	
				"size" => 1,	
				"minitems" => 0,
				"maxitems" => 1,
			)
		),

the userfunction won't work.

Is there a way to not only use this userfunction in the ext_tables.php 
but also in the tca.php?

Cheers
Lars


More information about the TYPO3-english mailing list