[TYPO3-english] external_import, nesting pages
David Greiner
davidgreiner at gmx.net
Fri Jan 30 14:33:12 CET 2015
Hi François!
Thanks for your fast reply and thanks for your awesome work with
ext:external_import!
The mapping does the trick... No need for extra userfunction. Thanks a
lot! I have tried such a mapping before, probably with wrong arguments.
I have one more question. Is it correct, that my csv file gets imported
in a reverse order?
CSV1 does not work for the import.
CSV1:
-------
name,category_id,parent_id
test1,1,1091
test2,2,1
test3,3,1
test4,4,1
test5,5,1091
test6,6,1091
test7,7,1091
test8,8,1091
test9,9,8
test10,10,8
-------
CSV2 does import all the data correctly:
CSV2:
-------
name,category_id,parent_id
test10,10,8
test9,9,8
test8,8,1091
test7,7,1091
test6,6,1091
test5,5,1091
test4,4,1
test3,3,1
test2,2,1
test1,1,1091
-------
Its still the same content, just reversed.
Best greetings
David.
Am 30.01.2015 um 13:36 schrieb François Suter:
> Hi David,
>
>> In this userfunction i check for currently existing pages which
>> "tx_vtmmage_magento_category_id" == "the current external parent_id". If
>> there is a result, the uid of this page will be returned and should be
>> used as pid for the new record.
>>
>> Unfortunately this pid gets overridden while importing and all new
>> records gets defined 'pid' => 97" from the ctrl section.
>
> Have you checked that your function works as expected? Normally
> external_import will not override the "pid" field if it already
> contains a value, so my guess is that your function returns nothing.
>
> BTW have you tried simply mapping the pid field to the pages table
> itself, i.e. something like:
>
> $GLOBALS['TCA']['pages']['columns']['pid']['external'] = array(
> 0 => array(
> 'field' => 'parent_id',
> 'mapping' => array(
> 'table' => 'pages',
> 'reference_field' => 'tx_vtmmage_magento_category_id'
> )
> )
> );
>
> This should normally work.
>
> HTH
>
More information about the TYPO3-english
mailing list