.. include:: /Includes.rst.txt .. _ctrl-reference-formattedlabel-userfunc: ======================== formattedLabel\_userFunc ======================== .. confval:: formattedLabel_userFunc :name: ctrl-formattedlabel-userfunc :Path: $GLOBALS['TCA'][$table]['ctrl'] :type: string :Scope: Display Similar to :ref:`label_userFunc ` but allows to return formatted HTML for the label **and is used only for the labels of inline (IRRE) records**. The referenced user function may receive optional arguments using the :ref:`formattedLabel_userFunc_options ` property. .. tip:: Read more about :ref:`Inline Relational Record Editing (IRRE) `. Examples ======== .. todo: Use a new example, see https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-TCA/issues/727 .. note:: This example is outdated: the :php:`UserFileInlineLabelService` class has been deprecated with TYPO3 v12.0 and removed with TYPO3 v13.0. * Example from table "sys_file_reference":: 'formattedLabel_userFunc' => TYPO3\CMS\Core\Resource\Service\UserFileInlineLabelService::class . '->getInlineLabel', 'formattedLabel_userFunc_options' => [ 'sys_file' => [ 'title', 'name' ] ], In this example, :php:`getInlineLabel` will be called with an array of :php:`$parameters` which is passed by reference. This array consists of the following keys (and values): * `table`: The table name of the current record * `row`: The database row of the current record * `isOnSymmetricSide`: True if we are looking from the symmetric ("other") side *to* the relation * `options`: The options configured in TCA - see :ref:`formattedLabel_userFunc_options ` * `parent`: Contains another array with the keys `uid` (referencing the inline child's parent uid) and `config` (referencing the parent configuration) * `title`: Initialized to an empty string, this is the title that is manipulated by the user function The resulting title must be written to :php:`$parameters['title']`. .. seealso:: See class :php:`TYPO3\CMS\Core\Resource\Service\UserFileInlineLabelService` for how such a user function should be designed and how the options are used.