ReStructured Text InfrastructureTYPO3 CMS - What's Newwiki.typo3.orgTYPO3 CMS Documentation

Feature #49716

label_func addition for rendering IRRE headers

Added by Markus Klein about 2 years ago. Updated about 1 year ago.

Status:Closed Start date:2013-07-05
Priority:Must have Due date:
Assigned To:Francois Suter % Done:

100%

Category:-
Target version:6.2.0

Description

The new TCA option 'label_userFunc_options' allows to pass additional information to the label_userFunc.

Example:

'ctrl' => array(
    'title' => 'LLL:EXT:lang/locallang_tca.xlf:theTable',
    'label' => 'uid',
    'label_userFunc' => 'UserFunc.php:UserFunc->getInlineLabel',
    'label_userFunc_options' => array(
        'special' => array(
            'this',
            'that'
        )
    )
)

The getInlineLabel() can set the title as follows:

public function getInlineLabel(array &$params) {
    $fields = isset($params['options']['special']) && is_array($params['options']['special'])
        ? $params['options']['special']
        : array();
    $title = array();
    foreach ($fields as $f) {
        $title[] = $params['row'][$f];
    }
    $params['title'] = '<dl>' . implode('', $title) . '</dl>';


Related issues

related to TYPO3 CMS Usability Team - Suggestion #36052: Visual improvements for IRRE (in Fal) Resolved
related to Core - Bug #51411: Label user function for sys_file_reference uses HTML Resolved 2013-08-27
related to Core - Feature #49721: Add label_userFunc_options to BackendUtility Resolved 2013-07-06

Associated revisions

Revision 0386ee6b
Added by Francois Suter over 1 year ago

[FEATURE] Document formattedLabel_userFunc

Two new properties were added to the "ctrl" section of the TCA,
formattedLabel_userFunc and formattedLabel_userFunc_options.

Resolves: #49716
Releases: 6.2

Change-Id: Iab01736200c082d1e0b2ca7e61a37f9143fa8a8e
Reviewed-on: https://review.typo3.org/27732
Reviewed-by: Francois Suter
Tested-by: Francois Suter

History

#2 Updated by Philipp Gampe almost 2 years ago

The corresponding change needed a follow up, because the label must not contain markup.

Thus for IRRE headers, there is a new configuration option inlineLabel_userFunc with the same signature as the know label_userFunc. This new config option is prefered over the normal label user function.
The additional behavior with the label_userFunc_options is preserved, although it is not used for FAL IRRE fields.

#3 Updated by Ernesto Baschny almost 2 years ago

Please note that the follow-up is not finished / reviewed (#51411) yet, so this is not in the core. But this has to be fixed because the current behaviour breaks some backend elements (Workspaces, Sys-log..)

#4 Updated by Markus Klein almost 2 years ago

The follow-up is merged now. The new label option is called "formattedLabel_userFunc". The user can provide a function that returns a HTML formatted label for a row. As of 6.2 this only used for displaying IRRE inline element headers.

#5 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Documentation/TYPO3/Reference/Tca has been pushed to the review server.
It is available at https://review.typo3.org/27732

#6 Updated by Francois Suter over 1 year ago

  • Assigned To set to Francois Suter

#7 Updated by Francois Suter over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#8 Updated by Francois Suter about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF