Skip to content

Plugins with CType list are not called #834

Open

Description

@andreaswolf

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

  1. Have a plugin configured in CType list
  2. 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>

Activity

  1. lukaszuznanski commented on Aug 22, 2025

    @lukaszuznanski
    Collaborator
  2. andreaswolf commented on Aug 22, 2025

    @andreaswolf
    Author

    Yeah, as far as I can tell from a quick look this is very similar. I'm also not sure if there is a way to configure this globally. But maybe there could be some default configuration that at least points people to the fact that they still need to configure something, like the default "no rendering found for content type XYZ" that is shipped with fluid_styled_content IIRC.

    In our case we mostly only have "homegrown" plugins, so we will switch to native JSON output in the actions anyways, and since I now know that this needs to be configured, I'm good. Furthermore, CType list is also bound to vanish in the next years.

  3. lukaszuznanski commented on Aug 22, 2025

    @lukaszuznanski
    Collaborator

    That's true, and for now we declare plugins as CTypes anyway - that's something to update in documentation.

    We have some documentation on list type also https://docs.typo3.org/p/friendsoftypo3/headless/main/en-us/Developer/Index.html#internal-extbase-plugins

    but I agree with you that we should provide some example.
    If there is a case that there is no tt_content that matches, there is error displayed, take a look here: https://github.com/TYPO3-Headless/headless/blob/master/Configuration/TypoScript/ContentElement/Default.typoscript#L11

  4. jawher-tabessi commented on Oct 15, 2025

    @jawher-tabessi

    Hi @lukaszuznanski

    I'm revisiting this topic because I'm currently creating plugins with ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT to be compatible with this changelog https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.4/Deprecation-105076-PluginContentElementAndPluginSubTypes.html#deprecation-105076-1726923626
    But based on this code example https://docs.typo3.org/p/friendsoftypo3/headless/main/en-us/Developer/Index.html#internal-extbase-plugins and changing list_type to CType, it doesn't work.
    Is this change already in place in headless ? I'd appreciate an example if so. If not, is it planned to be integrated ?

    Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions