Feature #17606
closed
Enable overriding/renaming field labels by Page TSconfig
Added by Malte Jansen about 17 years ago.
Updated over 14 years ago.
Description
You can override Item-Labels with TCEFORM.[table].[field].altLabels.[ID] = New Label
But it is not possible to rename the label of a field. Sometime it is indispensable to rename a field because you use the same table/column for different content or categories.
So there is a very easy solution to solve this problem. You only have to add one line in the t3lib.
Datei: class.t3lib_tceforms.php
Klasse: getSingleField()
Before:
$PA['label'] = $PA['altName'] ? $PA['altName'] : $PA['fieldConf']['label'];
$PA['label'] = $this->sL($PA['label']);
After:
$PA['label'] = $PA['altName'] ? $PA['altName'] : $PA['fieldConf']['label'];
$PA['label'] = $PA['fieldTSConfig']['label'] ? $PA['fieldTSConfig']['label'] : $PA['label']; // Creates TCEFORM.[table].[field].label = New Label
$PA['label'] = $this->sL($PA['label']);
Example for usage in the PageTS:
TCEFORM.[table].[column].label = New Label
TCEFORM.[table].[column].label = LLL:EXT:my_ext/locallang_db.php:table.column
(issue imported from #M6346)
Files
The Problem is now solved in the Extension maja_labelrename...
But it would be very useful as property of the core...
I've created a unified diff for your feature request.
The types section of the TCA has the possibility to set an alternative label for fields - thus it would have been possible to reuse a table in an other extension and define a different label for the context of that extension.
Hi Oliver!
It would be pretty cool, if you could replace a whole Locallang via PageTS.
In my Extension it works fine for Field-Labels, but it does not work with Div-Tabs or Item-Labels, because there is no Hook.
Example: TCEFORM.[table].locallang = LLL:EXT:my_ext/locallang_db.php
My idea is, that you could change the sL() of the lang extension and have some syntax like:
page:LOCALLANG.[extension].[file].extension = my_ext/
page:LOCALLANG.[extension].[file].file = locallang_db.php
or
page:LOCALLANG.[extension].[file].altFile = my_ext/locallang_db.php
I will try to make a XCLASS and test it....
I have a "clean" solution for a whole locallang-file...
A documation is in the Extension: maja_labelrename (version 0.0.4)...
@Oliver:
With the PageTS solution you can reuse the whole extension for an other purpose.
For example the tt_news.
An other aspect is that you do not have to backup your locallang-file, if you update an extension.
I've added a patch which can be used instead of the xclass.
Please, see the documentation of my extension for details.
Added New Patch, corresponding to the developer-thread:
TCEFORM.[table].[column].label = LLL:EXT:my_ext/locallang_db.php:table.column
TCEFORM.[table].[column].label.default = New Label
TCEFORM.[table].[column].label.de = Neuer Feldname
Committed to Trunk (rev. 2734)
Also available in: Atom
PDF