Describe the bug
First of all: I'm still on EXT:headless v3, so maybe this is not an issue on v4; I have not checked that yet.
As said, the plugin is not called (due to missing TypoScript configuration, but this can easily be fixed on a per-plugin base, probably not so easy on a global base).
To Reproduce
- Have a plugin configured in CType list
- Return JSON in that plugin, either directly as a
JsonResponse or via generating JSON in the Fluid template (cf. EXT:headless_news)
Expected behavior
The plugin is called and my content is part of the JSON object in PageData.
Screenshots
If applicable, add screenshots to help explain your problem.
TYPO3 version and TYPO3 Headless version
TYPO3 v11 and EXT:headless 3.x latest version
Additional context
It seems as if the JSON content object does not resolve the list_type field in the shipped default configuration. In the fluid_styled_content, this switch is also not done via the CASE cObject, but via the List cObject's template, which renders the relevant tt_content.list.20.<list_type> TS object.
I managed to get rendering working with this configuration:
tt_content.list = COA
tt_content.list.20 = CASE
tt_content.list.20 {
key.field = list_type
myextension_myplugin >
myextension_myplugin =< lib.contentElement
myextension_myplugin {
fields.type = TEXT
fields.type.field = list_type
fields.content = USER
fields.content {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
extensionName = MyExtension
pluginName = MyPlugin
}
}
}
The action was changed to this:
[…]
return $this->jsonResponse(json_encode(['foo' => 'bar'));
}
The return value of the action is then available as single properties in the content object, in my example T3CeMyextensionMyplugin:
<script setup lang=ts>
const props = defineProps<{
foo: string,
}>()
</script>
Describe the bug
First of all: I'm still on EXT:headless v3, so maybe this is not an issue on v4; I have not checked that yet.
As said, the plugin is not called (due to missing TypoScript configuration, but this can easily be fixed on a per-plugin base, probably not so easy on a global base).
To Reproduce
JsonResponseor via generating JSON in the Fluid template (cf. EXT:headless_news)Expected behavior
The plugin is called and my content is part of the JSON object in PageData.
Screenshots
If applicable, add screenshots to help explain your problem.
TYPO3 version and TYPO3 Headless version
TYPO3 v11 and EXT:headless 3.x latest version
Additional context
It seems as if the JSON content object does not resolve the list_type field in the shipped default configuration. In the fluid_styled_content, this switch is also not done via the CASE cObject, but via the List cObject's template, which renders the relevant tt_content.list.20.<list_type> TS object.
I managed to get rendering working with this configuration:
The action was changed to this:
[…] return $this->jsonResponse(json_encode(['foo' => 'bar')); }The return value of the action is then available as single properties in the content object, in my example
T3CeMyextensionMyplugin: