[TYPO3-dev] Creating pages in Typo3 with external script
Alexander Födisch
foedisch at eva.mpg.de
Tue Feb 11 08:13:51 CET 2014
Hi all,
thanks for your answers and hints. Sure, the best way would be TCEmain. But therefor I need a TYPO3 backend
context, right?
But I have to integrate the creation of TYPO3 pages (and users with their filemounts) into another software
for simplifying processes. :-(
Best,
Alex
Am 11.02.2014 07:47, schrieb Jigal van Hemert:
> Hi,
>
> On 10-2-2014 21:59, Stephan Schuler wrote:
>> I wouldn't try to inject data into the TYPO3 database without using
>> the internal PHP API. There are tons of things to take care of. Like
>> authors, workspace overlays, translations, history data, diffs inside of
>> those history data, sorting, access privileges, maybe flex when it comes
>> to different plugin inline configuration ...
>
> True. For an import I did a two-pass method.
> First pass would insert all pages below the point where the entire tree should be imported to (TYPO3 4.x site):
>
> /** @var $tce t3lib_TCEmain */
> $tce = t3lib_div::makeInstance('t3lib_TCEmain');
> $tce->start($data, array());
> $tce->process_datamap();
> $newPageId = $tce->substNEWwithIDs['NEW'];
>
> The new page ID (the TYPO3 page id) is stored with the imported record to be able to rebuild the old page
> tree structure.
>
> The second pass moves a page to the final position:
>
> $cmd['pages'][$record['newuid']]['move'] = $parentRecord['newuid'];
> ...
> $tce->start(array(), $cmd);
> $tce->process_cmdmap();
>
> More about using t3lib_TCEmain (in 6.x \TYPO3\CMS\Core\DataHandling\DataHandler):
> http://blog.tolleiv.de/2010/03/handling-data-in-typo3-with-tcemain/
>
More information about the TYPO3-dev
mailing list