Menu


Alternative labels for tables


Sometimes you need to display an alternative or a combined label for table records in TYPO3's backend. For example if you have a table with members who have first name and last name fields. When you create the extension with TYPO3 Kickstarter? it will set one of this fields as label so your records will be displayed in the backend using that label. But setting the first name to a label in this case will not help the editor to identify who is who among the members, using last name only will also not be of much help.

In this case we need to combine first name and last name to be a combined label. How can we do this ? Well it's possible by editing the table definition in the ext_tables.php file:

Usually there the label is defined like this:


'label' => 'first_name',


after this config you need to add the following to force the combination of the labels:


'label_alt' => 'last_name',
'label_alt_force' => TRUE,


Clear the cache and enjoy. Now your records are displayed with a label like : first_name last_name




Google Search

 
wiki.lacisoft.com
WWW
2009-2011 (c) Lacisoft.com