[TYPO3-mvc] Correct way of creating language overlay records
Robert Böttner
robert at boettner.it
Tue Oct 2 07:46:41 CEST 2012
Hi everybody,
do your TCA model definitions contain these parts?
$TCA['tx_yourext_domain_model_entity'] = array (
'ctrl' => array (
...
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l18n_parent',
'transOrigDiffSourceField' => 'l18n_diffsource',
...
)
);
$TCA['tx_yourext_domain_model_entity'] = array (
'types' => array(
'1' => array('showitem' => 'l18n_parent, sys_language_uid, yourproperties, ... '),
),
'columns' => array(
'sys_language_uid' => array(
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.language',
'config' => array(
'type' => 'select',
'foreign_table' => 'sys_language',
'foreign_table_where' => 'ORDER BY sys_language.title',
'items' => array(
array('LLL:EXT:lang/locallang_general.php:LGL.allLanguages', -1),
array('LLL:EXT:lang/locallang_general.php:LGL.default_value', 0)
),
)
),
'l18n_parent' => array(
'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.l18n_parent',
'config' => array(
'type' => 'select',
'items' => array(
array('', 0),
),
'foreign_table' => 'tx_yourext_domain_model_entity',
'foreign_table_where' => 'AND tx_yourext_domain_model_entity.uid=###REC_FIELD_l18n_parent### AND tx_yourext_domain_model_entity.sys_language_uid IN (-1,0)',
)
),
'l18n_diffsource' => array(
'config' => array(
'type' =>'passthrough',
)
),
...
)
);
Best
Robert.
Am 02.10.2012 um 07:01 schrieb Stefano Cecere <scecere at krur.com>:
> prenote: AFAIK languages and workspaces are not supported in Extbase (maybe there's something for 6.x)
>
> i would write a direct mysql statement (no Extbase query) in the repository class to add these overlays!
> (i do this often to bypass the sometimes damned db query engine!)
>
> ciao
> stefano
>
> On 28/09/12 09:35, Matthias Krappitz wrote:
>> Hi,
>>
>> is there an official way, to create language overlay records for custom
>> records in an extbase extension? I have several records in my extension
>> and some of them needs to be localizable by frontend forms. So is there
>> at least an official programmatical way to do this in extbase? I already
>> tried writing getters for sys_language_uid, l10n_parent and t3_origuid
>> and setting values as needed for an overlay, but Extbase does not
>> persist those fields, all values remain zero. Or even better, is there a
>> way to do this using the fluid form viewhelper and its object / property
>> binding?
>>
>> Best Wishes
>>
>> Matthias Krappitz
>> w. www.aemka.de
>
>
> --
>
> -- --- ----- -------
>
> Stefano Cecere
> KRUR studio - http://krur.com
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
--
boettner.it - Informationstechnologie
Robert Böttner
Rosenstraße 11
70771 Leinfelden-Echterdingen
07 11 - 504 502 72 fon
07 11 - 504 502 74 fax
01 78 - 4 10 63 19 mobil
http://www.boettner.it
More information about the TYPO3-project-typo3v4mvc
mailing list