Project

General

Profile

Actions

Feature #17606

closed

Enable overriding/renaming field labels by Page TSconfig

Added by Malte Jansen about 17 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2007-09-14
Due date:
% Done:

0%

Estimated time:
PHP Version:
4.3
Tags:
Complexity:
Sprint Focus:

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

0006346.patch (1.1 KB) 0006346.patch Administrator Admin, 2007-09-17 15:09
class.tx_majalabelrename_tceforms_xclass.php (4.64 KB) class.tx_majalabelrename_tceforms_xclass.php Administrator Admin, 2007-09-18 18:51
PageTS_LOCALLANG_v1.patch (4.57 KB) PageTS_LOCALLANG_v1.patch Administrator Admin, 2007-10-09 21:02
LabelOverriding_v1_(trunk).patch (736 Bytes) LabelOverriding_v1_(trunk).patch Administrator Admin, 2007-11-06 14:53
Actions #1

Updated by Malte Jansen about 17 years ago

The Problem is now solved in the Extension maja_labelrename...
But it would be very useful as property of the core...

Actions #2

Updated by Oliver Hader about 17 years ago

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.

Actions #3

Updated by Malte Jansen about 17 years ago

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....

Actions #4

Updated by Malte Jansen about 17 years ago

I have a "clean" solution for a whole locallang-file...

A documation is in the Extension: maja_labelrename (version 0.0.4)...

Actions #5

Updated by Malte Jansen about 17 years ago

@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.

Actions #6

Updated by Malte Jansen about 17 years ago

I've added a patch which can be used instead of the xclass.

Please, see the documentation of my extension for details.

Actions #7

Updated by Malte Jansen about 17 years ago

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

Actions #9

Updated by Oliver Hader about 17 years ago

Committed to Trunk (rev. 2734)

Actions

Also available in: Atom PDF