[TYPO3] How to get extension to insert exising tt_content on another page

Anders Tillbeck at at opengate.dk
Mon Apr 30 15:33:26 CEST 2007


> 1)  My extension shall insert one of these content elements (from page 
> id=5) on a other pages as a reference?
> I guess it must be something like:
> // load tt_content
> t3lib_div::loadTCA('tt_content');
> // this is the function I need
> insert_tt_Content($uid_of_the_tt_content_to_be_inserted);
> 
> 2) A more tricky one... I would like to make a dublicate of an exsisting 
> row from tt_content. In the process of dublication I will have to change 
> the owner/author/lastEditBeUser or similiar to the user doing the 
> dublication. This can also be a custom field.
> Something like:
> //$uid of the tt_content to be dublicated
> //$newOwner, id of the be_user doing the dublication
> //$newContent, fine to let this one be blank
> dublicate_tt_content($uid,$newOwner,$newContent);
> 
> 
> BR. Anders

Answers for nr. 1
I foundi a post from 2004 from Gerd Reise.
Thank you Gerd :-)

// To get an exsisting tt_content with id 1 and 2 and 3
// and place then in the variable $parsedContent
$lCObj = t3lib_div::makeInstance("tslib_cObj");
$lConf = array('tables' => 'tt_content', 'source'=>'tt_content_1,2,3');
$parsedContent = $lCObj->RECORDS($lConf);
// insert the three tt_content elements on your site
print $parsedContent;

BR. Anders


More information about the TYPO3-english mailing list