I've setup a fresh Typo3 10.4LTS installation and inserted some content elements, as well Image, Textpic and Textmedia. Text content elements was rendered as expected and shown as in the examples mention, but Image, Textpic and Textmedia wasn't rendered and not part of the JSON output.
My environment:
what
version
PHP
7.4.13
Typo3
10.4.12
ext:headless
2.3.0
ext:headless_gridelements
1.0.4
ext:gridelements
10.0.0
Typo3 and extension simple installed by composer
no backend layout created
no missing elements wasn't placed in a grindelement
In JsonContentObject.php (line 81-86) I've found following lines:
if (isset($conf['fields.'])) {
$data = $this->cObjGet($conf['fields.']);
}
if (isset($conf['dataProcessing.'])) {
$data = $this->processFieldWithDataProcessing($conf);
}
Problem seems the origin data processing instruction from the core extension fluid_styled_contend, in the Typoscript are as well data processors defined (tt_content.textpic.dataProcessing).
I've setup a fresh Typo3 10.4LTS installation and inserted some content elements, as well Image, Textpic and Textmedia. Text content elements was rendered as expected and shown as in the examples mention, but Image, Textpic and Textmedia wasn't rendered and not part of the JSON output.
Output:
{ "position": { "horizontal": "center", "vertical": "above", "noWrap": false }, "width": 600, "count": { "files": 1, "columns": 1, "rows": 1 }, "columnSpacing": 10, "border": { "enabled": false, "width": 2, "padding": 0 }, "rows": { "1": { "columns": { "1": { "media": {}, "dimensions": { "width": 600, "height": 386 } } } } } },
In JsonContentObject.php (line 81-86) I've found following lines:
Problem seems the origin data processing instruction from the core extension fluid_styled_contend, in the Typoscript are as well data processors defined (tt_content.textpic.dataProcessing).
After clear them by Typoscript:
The content elements are rendered and shown in the outputted JSON and output is:
{ "id": 7, "pid": 1, "type": "textpic", "colPos": 1, "categories": "", "appearance": { "layout": "default", "frameClass": "default", "spaceBefore": "", "spaceAfter": "" }, "content": { "header": "Text & Image", "subheader": "", "headerLayout": 3, "headerPosition": "", "headerLink": "", "bodytext": "<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>", "gallery": { "position": { "horizontal": "center", "vertical": "above", "noWrap": false }, "width": 600, "count": { "files": 1, "columns": 1, "rows": 1 }, "columnSpacing": 10, "border": { "enabled": false, "width": 2, "padding": 0 }, "rows": { "1": { "columns": { "1": { "publicUrl": "http://typo3.headless.local/fileadmin/user_upload/755e9798cc02d4e8594a5aa08e9207ae.png", "properties": { "title": null, "alternative": null, "description": null, "mimeType": "image/jpeg", "type": "image", "filename": "755e9798cc02d4e8594a5aa08e9207ae.png", "originalUrl": "fileadmin/user_upload/755e9798cc02d4e8594a5aa08e9207ae.png", "uidLocal": 2, "fileReferenceUid": 2, "size": "93 KB", "link": null, "dimensions": { "width": 1008, "height": 650 }, "cropDimensions": { "width": 1008, "height": 650 }, "crop": { "default": { "cropArea": { "x": 0, "y": 0, "width": 1, "height": 1 }, "selectedRatio": "NaN", "focusArea": null } }, "autoplay": null, "extension": "png" } } } } } } } },
The execution of $conf['dataProcessing.'] overrides the before executed $conf['fields.'].
I hope I have not overlooked anything and it is my fault.
Best, Jens