简体   繁体   中英

TYPO3 - TCA - Dynamic Labels possible?

I am currently writing the TCA for a custom Domain-Model, representing data-records coming via an interface. I have a child-model being referenced by its parent, and I would love to be able to build the label ("title") for a specific record dynamically based on a value of one of its properties (of the child-record). Does anybody know how to achieve this !? Thanks in advance !

Further info/details :

'childrecords' => array(
        'exclude' => 1,
        'label' => 'Child Record',
        'config' => array(
            'type' => 'inline',
            'foreign_table' => 'childrecord_table',
            'foreign_field' => 'parentid',
            'foreign_label' => '<<<LABELFIELD>>>',
            'maxitems' => 9999,
            'appearance' => array(
                'collapseAll' => 1,
                'levelLinksPosition' => 'top',
                'showSynchronizationLink' => 0,
                'showPossibleLocalizationRecords' => 0,
                'useSortable' => 0,
                'showAllLocalizationLink' => 0
            ),
        ),
    ),

What I want to achieve, is to set the foreign_label (marked with placeholder <<>>) to a string representation for a numeric value available as a child-model-property. This string-description is NOT available as a childproperty directly (I have to set up a static array/table for those).

In short:

Side note, if this concerns LLL values (labels as such, not label field configuration values) you can override those with TypoScript which also supports some dynamic processing: https://wiki.typo3.org/TypoScript_language_additions,_override (old page but I believe this example still works, but not sure if it allows overriding BE labels that are not in the default locallang.xlf file).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM