Bug #33499
closed
Backend ignores l10n_mode in record titles
Added by Jonas Renggli almost 13 years ago.
Updated about 6 years ago.
Description
All titles of translated records are displayed as "[No title]" if the l10n_mode of the field selected as label is set to "exclude".
This is quite annoying because editors get a list including dozens of records titled with "[No title]" when editing records in list module. The editor can help himself by activating "Localization view" this way records are shown as following:
What do you think about using the same value as title in backend that is already used in frontend (e.g. extbase automatically uses l10n_mode). This would be much more consistent because editors can't even set the value for the title field (because it's excluded) but there's one displayed in FE.
Additional Information
$TCA['tx_abcd_table'] = array(
'ctrl' => array(
'label' => 'name',
...
'columns' => array(
'name' => array(
'l10n_mode' => 'exclude',
...
- title is generated in
getRecordTitle()
(t3lib/class.t3lib_befunc.php
)
Currently you can handle this in your own extensions with a label_userFunc (since Typo3 4):
//include file in ext_tables.php
t3lib_div::requireOnce(t3lib_extMgm::extPath($_EXTKEY) . 'Classes/Utility/TCAUserFunc.php');
//add label_userFunc
$TCA['tx_abcd_table'] = array(
'label' => 'name',
'label_userFunc' => 'Tx_ExtKey_Utility_TCALabelUserFunc->getLabel',
...
TCAUserFunc.php
class Tx_ExtKey_Utility_TCALabelUserFunc {
/**
* Set $params['title'] to label of $l10n_parent and label of sys_language if translation and title empty
*
* @param array $params
* @return void
*/
public function getLabel(array $params){
/**
* labelRow
*
* @var string
*/
$labelRow = 'name';
if ($params['row']['sys_language_uid'] > 0 && empty($params['row'][$labelRow])) {
$l10n_parent = t3lib_BEfunc::getRecord($params['table'], $params['row']['l10n_parent'],$labelRow);
$sys_language = t3lib_BEfunc::getRecord('sys_language', $params['row']['sys_language_uid'],'title');
$params['title'] = $l10n_parent[$labelRow] . ' - ' . $sys_language['title'];
} else {
$params['title'] = $params['row'][$labelRow];
}
}
}
- Status changed from New to Under Review
Test this by simply setting in typo3conf/ext_tables.php:
t3lib_div::loadTCA('tt_content');
$GLOBALS['TCA']['tt_content']['columns']['header']['l10n_mode'] = 'exclude';
$GLOBALS['TCA']['tt_content']['ctrl']['label_alt'] = '';
Then you translate any content element and [No Title] will be shown without the patch.
(Note: Nobody would do this for tt_content, but it's relevant for extension tables. tt_content is just a nice way to test.)
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Under Review
- Status changed from Under Review to Resolved
- Status changed from Resolved to Closed
Also available in: Atom
PDF