[TYPO3-dev] Extension enable translation for a field

Ronald Renfro rr at dreimorgen.com
Fri Dec 5 10:16:19 CET 2008


I found a sollution by following the good example of the realurl  
extension...

In order to have the field available for translation you need to edit  
the file
ext_tables.sql. Add the field to the pages_language_overlay table. for  
example

---
CREATE TABLE pages_language_overlay (
	tx_myextension_myfield varchar(60) DEFAULT '' NOT NULL,
);
---

You must also add the appropriate information to the ext_tables.php  
file:

---
$TCA['pages_language_overlay']['columns'] += array(
	'tx_myextension_myfield' => array(
		'label' => ...,
		'exclude' => 1,
		etc.
	),
);

t3lib_extMgm 
::addToAllTCAtypes('pages_language_overlay',"tx_myextension_myfield;;;; 
1-1-1");
---

The ext_emconf.php file must also be edited.
The array key $EM_CONF[$_EXTKEY]['modify_tables'] should indicate  
which table is being used/changed

in my case the pages table is being modified so...
$EM_CONF[$_EXTKEY]['modify_tables'] => 'pages'

After these manual edits the field I needed to be translated finally  
showed up.
Hope this might help someone else...


On 04.12.2008, at 19:23, Ronald Renfro wrote:

> Hi List,
>
> I am developing a simple extension that extends the pages db table by
> adding an additional media field. When I create a translation of a
> page the new field is not displayed. How can I specifiy in my
> extension that this field can be translated e.g. every translation of
> a page can have a different background image.
>
> Thanks in advance.
>
> Best regards
> Ronald
>
>
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev




More information about the TYPO3-dev mailing list