[TYPO3] Novice: TCA select box with other column than the 'uid'

Xavier Perseguers [typo3] pub at perseguers.ch
Tue Nov 13 16:23:35 CET 2007


Hello,

I just created a few tables for a new extension. I used database relations for some fields in order to relate records from one table to ones of another.

To be clearer:

table 'parish' with fields 'name' and 'website'
table 'church' with fields 'name' and 'parish', this latest field being a link to the parish table.

Now always with the kickstarter extension, I got the tca.php file generated:

$TCA["tx_masscalendar_churches"] = Array (
        "columns" => Array (
                // stripped
                "parish" => Array (
                        "exclude" => 0,
                        "label" => "LLL:EXT:mass_calendar/locallang_db.xml:tx_masscalendar_churches.parish",
                        "config" => Array (
                                "type" => "select",
                                "items" => Array(
                                        Array( '', 0 )
                                        ),
                                "foreign_table" => "tx_masscalendar_parishes",
                                "foreign_table_where" => "AND tx_masscalendar_parishes.pid=###CURRENT_PID### ORDER BY tx_masscalendar_parishes.name",
                                "size" => 1,
                                "minitems" => 0,
                                "maxitems" => 1,
                                "eval" => "required",
                        )
                ),

The problem is that I get a drop down list with parish UID and not its column 'name'. I tried changing the setting 'label' in ext_tables.php but it has no effect on the drop down list.

How should I get this? It's surely trivial but I cannot find it in the documentation. The only thing I find is defining a userFunc to create the list of items, which is, I think, a too complicated way achieving this goal.

Any help?

Thanks
Xavier


More information about the TYPO3-english mailing list