---
title: "Create Extbase Plugins"
manual: "Content Blocks"
version: "main"
permalink: "https://docs.typo3.org/permalink/friendsoftypo3/content-blocks:create-extbase-plugin@main"
source: "Guides/CreateExtbasePlugin/Index.rst"
rendered: "2026-09-22T14:15:39+00:00"
---

# Create Extbase Plugins {#create-extbase-plugin}

This guide demonstrates how to create Extbase plugins using Content Blocks.

## Create a new Content Block {#create-a-new-content-block}

**EXT:site_package/ContentBlocks/ContentElements/artists/config.yaml**

```yaml
name: vendor/artists-list
group: plugins
```

**EXT:site_package/ContentBlocks/ContentElements/artists/templates/frontend.fluid.html**

```html
<f:cObject typoscriptObjectPath="{data.mainType}.{data.recordType}.20" table="{data.mainType}" data="{data}"/>
```

## Add TypoScript {#add-typoscript}

For `extensionName` and `pluginName` use the names as configured in the next step.

**EXT:site_package/Configuration/TypoScript/setup.typoscript**

```typoscript
tt_content.vendor_artistslist.20 = EXTBASEPLUGIN
tt_content.vendor_artistslist.20 {
    extensionName = MyExtension
    pluginName = MyPlugin
    # If your controller returns a HTML response, set the template path like this:
    view {
        templateRootPaths.0 = EXT:site_package/ContentBlocks/ContentElements/artists/templates
    }
}
```

## Register Controller Actions {#register-controller-actions}

**EXT:site_package/ext_localconf.php**

```php
ExtensionUtility::registerControllerActions(
    'MyExtension',
    'MyPlugin',
    [
        ArtistController::class => ['list']
    ],
    [
        ArtistController::class => []
    ]
);
```

> [!NOTE]
> **Why not just use configurePlugin / registerPlugin?**
>
> TYPO3 has a helper method to quickly create plugins in ExtensionUtility::configurePlugin/registerPlugin
>
> In the background, it will create a completely new Content Element, which just copies the "Header" element.
> If you need custom fields or FlexForm configuration, you need to manually override the element.
> But if you create the Content Element with Content Blocks and only register the controller actions
> for it via the utility, you have the full power of Content Blocks on your side. You can quickly create
> FlexForm config and manage labels, icons etc. in your component.

> [!NOTE]
> registerControllerActions is an internal method, but it is unlikely to change in version 13. This way of adding plugins is experimental.

## Example Controller {#example-controller}

This controller simply passes the data from your Content Block to the Fluid template.

**EXT:site_package/Classes/Controller/ArtistController.php**

```php
<?php

declare(strict_types=1);

namespace Vendor\MyVendor\Controller;

use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

class ArtistController extends ActionController
{
    public function listAction(): ResponseInterface
    {
        /** @var ContentObjectRenderer $contentObject */
        $contentObject = $this->request->getAttribute('currentContentObject');
        $dataFromTypoScript = $contentObject->data;

        $this->view->assign('data', $dataFromTypoScript);

        return $this->htmlResponse();
    }
}
```

See also:

-   [Extbase Plugins](https://docs.typo3.org/m/typo3/reference-typoscript/14.3/en-us/ContentObjects/Extbaseplugin/Index.html#cobj-extbaseplugin)
