[TYPO3-english] Extending TYPO3 Copy-Paste ability

Bernhard Kraft kraftb at kraftb.at
Fri Oct 16 15:03:56 CEST 2009


Sancar Saran schrieb:

> Recently one of our customers wants to multi domain setup on his TYPO3 setup. 
> After some check we find, we have to extend copy - paste ability of TYPO3. Our 
> custom page design system have own page setup data on seperated db table.
> 
> So we need to add some lines into copy paste system to copy our db records 
> too.
> 
> How can we do this ? Where should I put my code in TYPO3 lib ?

Best solution would be, to integrate your records into the TYPO3
database system, which in fact means you would have to write a TCA
definition for it. You can read about "TCA" (=Table Configuration Array)
here:

http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.2.0/view/4/1/

Mostly all your own custom tables need to be TYPO3 compatible are fields
named "uid/pid" for storing an unique ID for each record, and the pid
field for storing the page the records can be found on.

Then just creat a TCA in typo3conf/extTables.php, or your own extension.
Almost any extension adding a table has a "tca.php", have a look at them
do understand how they work.

If you then place your records on some page, and copy them, TYPO3 will
take care to also copy them over to the new page.


As an alternative, you could use a hook in t3lib/class.t3lib_tcemain.php
to take required steps whenever you copy a record. You can read about
hooks here:

http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.2.0/view/3/4/


greets,
Bernhard


More information about the TYPO3-english mailing list