[Typo3] label_alt and select-box (MM)

Simon Tuck e-mailNO at SPAMeyejet.com
Fri Oct 21 10:16:21 CEST 2005


valli wrote:
> Hello all,
> We are trying something like the following:
> 
> In a backend extension we have a database structure like this:
> 
> 
>             categories
>                 |
>                 ^
> sellers      products
>    |            |
>    ^            ^
> sellers_products_mm
> 
> 
> Our goal is to display in the backend a select box in the
> interface of the table 'sellers' with not only strings from
> the 'products' table but also concatenated strings from the
> 'categories' table.
> 
> We tried the following things:
> - introduced the 'label_alt' and 'label_alt_force' in
>   the $TCA['products']['ctrl'] array in the file ext_tables.php.
>   => The label is now expanded and will also displayed in the
>      mm-select-box of sellers.
>   Problem: We found no way to include a string-field from 'categories'
>            in the label_alt.
>            => So it won't displayed in the mm-select-box
> 
> - do an ugly Hack: tried to select a join of categories and products
>   in tca.php and overwrite $TCA["sellers"]["columns"]["products"].
>   ("type" => "select"). Instead of 'foreign_table' fill the 'items'
>   array.
>   => Unfortunately doesn't work for MM.
> 
> 
> Thanks for any ideas.
> 
> valli
Check the TCA docs: you can include your own php script to define the label and the values of a column. you will probably 
need to do this for the catagories and the select box respectively.
An example would be:
	"field_name" => Array (		
		"exclude" => 1,		
		"label" => "lang_field",		
		"config" => Array (
			"itemsProcFunc" => 'myclass->myfunction'
			etc...
Cheers
simon



More information about the TYPO3-english mailing list