TYPO3 v12: Use DataHandler to create page with file references

raw

Code.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
$data = [
    'pages' => [
        'NEWpage23' => [
            'pid'    => 3,
            'title'  => 'Testpage',
            'hidden' => 0,
            'media'  => 'NEWref42',
        ],
    ],
    'sys_file_reference' => [
        'NEWref42' => [
            'uid_local'   => 'sys_file_21',
            'pid'         => 'NEWpage23',
        ],
    ],
];
 
$this->dataHandler->start($data, []);
$this->dataHandler->process_datamap();
 
Christian Weiske Christian Weiske
owner

History