PHPackages                             spooner-web/tcabuilder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. spooner-web/tcabuilder

ActiveTypo3-cms-extension[Utility &amp; Helpers](/categories/utility)

spooner-web/tcabuilder
======================

Utility to easily maintain and create your TCA forms

3.3.0(1y ago)636.1k↓45.5%GPL-2.0-or-laterPHPPHP &gt;= 7.4, &lt; 8.4

Since Aug 7Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/spoonerWeb/tcabuilder)[ Packagist](https://packagist.org/packages/spooner-web/tcabuilder)[ Fund](https://paypal.me/Tomalo)[ RSS](/packages/spooner-web-tcabuilder/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (24)Used By (0)

The TCA Builder
===============

[](#the-tca-builder)

[![pipeline status](https://camo.githubusercontent.com/df9d6f951f927a1a946d2696c1295ba37f46aa9156d76f377e555a4f1cfd1650/68747470733a2f2f6769742e73706f6f6e65722e696f2f73706f6f6e65722d7765622f7463616275696c6465722f6261646765732f6d61696e2f706970656c696e652e737667)](https://git.spooner.io/spooner-web/tcabuilder/-/commits/main)[![coverage report](https://camo.githubusercontent.com/eb1022bcedaed881559df57067fb8b9663642d4f7f9b63babbb4c35004a84c5e/68747470733a2f2f6769742e73706f6f6e65722e696f2f73706f6f6e65722d7765622f7463616275696c6465722f6261646765732f6d61696e2f636f7665726167652e737667)](https://git.spooner.io/spooner-web/tcabuilder/-/commits/main)[![Latest Version](https://camo.githubusercontent.com/992172b2864a2a9796dc8c9e3f317b282379c312dbfca4ddde5da3db4a335069/68747470733a2f2f6769742e73706f6f6e65722e696f2f73706f6f6e65722d7765622f7463616275696c6465722f2d2f6a6f62732f6172746966616374732f6d61696e2f7261772f6261646765732f6c617465737456657273696f6e2e7376673f6a6f623d4372656174652b4261646765)](https://git.spooner.io/spooner-web/tcabuilder/-/tags)

What does it do?
----------------

[](#what-does-it-do)

With the TCA builder you have the possibility to create or change the fields in type list in an easy and speaking way.

Times of semicolons within field names are gone.

For example:

1. Compose the field list for the form of a content element or any other record
2. Change the types of existing definitions

### Introducing TcaCreator in v1.6.0

[](#introducing-tcacreator-in-v160)

With the TCA creator you have the possibility to create TCA forms from scratch and do not need to think about the configuration of the default fields like the `ctrl` section or the default fields in the `columns` section.

More to see in the [Examples Section](#examples-tca-creator)

Installation
------------

[](#installation)

### Installation via composer

[](#installation-via-composer)

`composer require spooner-web/tcabuilder`

> ⚠️ **In a composer install, the package won't be in typo3conf/ext folder but in vendor**

### Installation via classic mode

[](#installation-via-classic-mode)

1. Head to
2. Download the ZIP file
3. Upload it to your TYPO3 instance using non-composer mode

### Installation via Extension Manager

[](#installation-via-extension-manager)

1. Update your extension list
2. Search for "tcabuilder"
3. Install

### Composer fails checking out this package

[](#composer-fails-checking-out-this-package)

As composer is not able to detect the ZIP archive of a self-hosted GitLab instance, there may occur problems when deploying or building a project with this package.

To fix this issue, you need to add the GitLab built-in packagist API into the `repositories` section of your project composer.json:

```
{
	"type": "composer",
	"url": "https://git.spooner.io/api/v4/group/8/-/packages/composer/"
}
```

Usage
-----

[](#usage)

### General usage

[](#general-usage)

Recommendation is to use the `TcaBuilder` in the php files of your `Configuration/TCA/Overrides/` folder of your extension.

1. Instantiate the `TcaBuilder` class
2. Set the table and type to configure (may also be a not existing type yet)
3. Use the methods to manipulate
4. Save to the TCA
5. Flush caches
6. See result

### Methods

[](#methods)

#### Main methods

[](#main-methods)

Method nameDescriptionParameters`setTable`Sets the table to load configuration from`string` $tableName`setType`Sets the type to load configuration from`string` $typeName`load`Loads configuration if it's an existing type`loadConfiguration`Shorter method to run `setTable`, `setType` and `load` at once`string` $tableName
 `string` $typeName`useLocalLangFile`Set a locallang file (beginning with `EXT:`) to use in labels`string` $localLangFile`saveToTca`Saves the manipulated configuration to TCA`bool` $resetAfterSave (optional)`returnAsArray`Instead of saving the configuration it returns it directly as array#### Manipulating types

[](#manipulating-types)

Method nameDescriptionParameters`addField`Adds a field to selected type`string` $typeName
 `string` [$position (optional)](#positioning)
 `string` $alternativeLabel (optional)`removeField`Removes a field from selected type`string` $fieldName`moveField`Moves a field to a new position (alternatively with a new label)`string` $fieldName
 `string` [$newPosition](#positioning)
 `string` $newLabel (optional)`addPalette`Adds an existing palette to selected type`string` $paletteName
 `string` [$position (optional)](#positioning)
 `string` $alternativeLabel (optional)`removePalette`Removes a palette from selected type`string` $paletteName`movePalette`Moves a palette to a new position (alternatively with a new label)`string` $paletteName
 `string` $newPosition
 `string` $newLabel (optional)`addDiv`Adds a div (tab) to selected type`string` $divName
 `string` $label`removeDiv`Removes a div (tab) from selected type, either by position (index, beginning with 0) or by label`string`|`int` $positionOrLabel`addOverride`Adds a custom override of a field`string` $fieldName
 `array` $configuration`initialize`Initializes the type with an empty list#### Manipulating palettes

[](#manipulating-palettes)

Method nameDescriptionParameters`addCustomPalette`Creates a new palette (and optionally inserts it directly to given position)`string` $paletteId
 `array` $fields
 `string` $label (optional)
 `string` [$position (optional)](#positioning)`addFieldToPalette`Adds a field to a palette`string` $paletteId
 `string` $field
 `string` [$position (optional)](#positioning)`removeFieldFromPalette`Removes a field from a palette`string` $paletteId
 `string` $field`initializePalette`Initializes the palette with an empty list`string` $paletteId#### Helper methods

[](#helper-methods)

Method nameDescriptionParametersReturns`getPaletteString`Finds the complete palette string which is used in list (for using it in position strings)`string` $paletteName`string` The complete palette string with `--palette--` and the possible label config`getDivString`Finds the complete div string which is used in list (for using it in position strings), either by position (index, beginning with 0) or by label`string`|`int` $positionOrLabel`string` The complete palette string with `--div--` and the div's label#### Possible values for positioning fields, palettes or divs

[](#possible-values-for-positioning-fields-palettes-or-divs)

ValueDescription`before:`Moves the item before the given item`after:`Moves the item after the given item`replace:`Replaces the given itemExamples (TCA builder)
----------------------

[](#examples-tca-builder)

### Add an own content element

[](#add-an-own-content-element)

```
$tcaBuilder = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\SpoonerWeb\TcaBuilder\TcaBuilder::class);
$tcaBuilder
    ->setTable('tt_content') // define table
    ->setType('test') // define type
    ->addDiv('General')
    ->addField('header', '', 'Top header!!')
    ->addField('bodytext')
    ->addField('subheader', 'after:header')
    ->addField('layout', 'before:header')
    ->addDiv('Extra')
    ->addPalette('access')
    ->addPalette('hidden', 'after:bodytext', 'Alternative label')
    ->saveToTca(); // save to TCA
```

### Change existing configurations

[](#change-existing-configurations)

```
$tcaBuilder = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\SpoonerWeb\TcaBuilder\TcaBuilder::class);
$tcaBuilder
    ->setTable('pages') // define table
    ->setType(\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_LINK) // define type
    ->load() // load definitions
    ->removeField('doktype')
    ->removePalette('external')
    ->removeDiv(1)
    ->addPalette('external', 'after:--palette--;;layout')
    ->saveToTca(); // save back to TCA
```

```
$tcaBuilder = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\SpoonerWeb\TcaBuilder\TcaBuilder::class);
$tcaBuilder
    ->loadConfiguration('pages', \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_MOUNTPOINT)
    ->removeDiv('LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata')
    ->movePalette('title', 'after:' . $tcaBuilder->getPaletteString('abstract'), 'New title')
    ->addOverride(
        'title',
        [
            'label' => 'New title',
            'config' => [
                'renderType' => 'inputLink'
            ]
        ]
    )
    ->saveToTca();
```

### Use language file

[](#use-language-file)

```
$tcaBuilder = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\SpoonerWeb\TcaBuilder\TcaBuilder::class);
$tcaBuilder
    ->loadConfiguration('pages', \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_MOUNTPOINT)
    ->useLocalLangFile('EXT:my_extension/Resources/Private/Language/locallang.xlf')
    ->addField('new_field', '', 'LANG:new_field') // Used label: "LLL:EXT:my_extension/Resources/Private/Language/locallang.xlf:new_field"
    ->saveToTca();
```

### Do minimal changes

[](#do-minimal-changes)

```
$tcaBuilder = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\SpoonerWeb\TcaBuilder\TcaBuilder::class);
$tcaBuilder
    ->loadConfiguration('tt_content', 'textmedia')
    ->removePalette('headers')
    ->saveToTca();
```

Examples (Tca Creator)
----------------------------------------------------------

[](#examples-tca-creator)

### Creating TCA configuration for a new table (inside custom extension)

[](#creating-tca-configuration-for-a-new-table-inside-custom-extension)

```
// Returns the default values of ctrl section
// By default language, version and sorting options are set
// These options can be unset and additional overridden fields can be set
$configuration['ctrl'] = \SpoonerWeb\TcaBuilder\TcaCreator::getControlConfiguration(
    'title',
    'label'
);

// Returns the default columns depending on the ctrl section configuration
// Example: If ctrl section includes language, this method returns the field configuration
// for all language fields (sys_language_uid, l10n_parent, l10n_diffsource, l10n_source)
$configuration['columns'] = \SpoonerWeb\TcaBuilder\TcaCreator::getColumnsConfiguration(
    $configuration['ctrl'],
    'tx_extension_domain_model_record',
    [
        'title' => [
            'label' => 'My label',
            'config' => [
                'type' => 'input'
            ]
        ]
    ]
);

// Uses TcaBuilder class to create the configuration for the TCA form
$configuration['types'][] = \SpoonerWeb\TcaBuilder\TcaCreator::buildTypesConfiguration()
    ->addDiv('General')
    ->addField('title')
    ->addField('subtitle')
    ->addDiv('Categories')
    ->addField('categories')
    ->returnAsArray();

// Now return TCA configuration
return $configuration;
```

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance58

Moderate activity, may be stable

Popularity32

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 98.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~91 days

Recently: every ~220 days

Total

17

Last Release

648d ago

Major Versions

1.6.1 → 2.0.02021-12-14

2.1.0 → 3.0.02022-11-30

PHP version history (8 changes)1.0.0PHP ^7.2

1.3.0PHP ^7.2

1.5.0PHP &gt;= 7.2, &lt; 8.0

2.0.0PHP &gt;= 7.4, &lt; 8.1

2.1.0PHP &gt;= 7.4, &lt; 8.2

3.0.0PHP &gt;= 8.1, &lt; 8.2

3.1.0PHP &gt;= 7.4, &lt; 8.3

3.2.0PHP &gt;= 7.4, &lt; 8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/141285789?v=4)[spooner](/maintainers/spooner)[@spooner](https://github.com/spooner)

---

Top Contributors

[![spoonerWeb](https://avatars.githubusercontent.com/u/1793083?v=4)](https://github.com/spoonerWeb "spoonerWeb (210 commits)")[![josefglatz](https://avatars.githubusercontent.com/u/2861556?v=4)](https://github.com/josefglatz "josefglatz (1 commits)")[![mbrodala](https://avatars.githubusercontent.com/u/5037116?v=4)](https://github.com/mbrodala "mbrodala (1 commits)")[![tomasnorre](https://avatars.githubusercontent.com/u/1212481?v=4)](https://github.com/tomasnorre "tomasnorre (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/spooner-web-tcabuilder/health.svg)

```
[![Health](https://phpackages.com/badges/spooner-web-tcabuilder/health.svg)](https://phpackages.com/packages/spooner-web-tcabuilder)
```

###  Alternatives

[fluidtypo3/flux

The flux package from FluidTYPO3

152982.2k20](/packages/fluidtypo3-flux)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

96374.6k23](/packages/friendsoftypo3-content-blocks)[wazum/sluggi

TYPO3 extension for URL slug management with inline editing, auto-sync, locking, access control, and redirects

39488.5k](/packages/wazum-sluggi)[eliashaeussler/typo3-form-consent

Extension for TYPO3 CMS that adds double opt-in functionality to EXT:form

1481.0k](/packages/eliashaeussler-typo3-form-consent)[b13/assetcollector

Add CSS and SVG files and strings as inline style tag/inline svg to the html code.

10118.4k](/packages/b13-assetcollector)[mautic/mautic-typo3

Add-on TYPO3 extension that enhances the "EXT:marketing\_automation" TYPO3 extension by connecting it to the Mautic Marketing Automation platform: Determine "Persona" from Mautic segments. Also provides additional services e.g. language synchronisation between Mautic and TYPO3.

236.3k](/packages/mautic-mautic-typo3)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
