Create new page type 

Deprecated since version 14.3

This example demonstrates how to add a new page type (doktype) called "Archive". Starting with TYPO3 v14, registration is streamlined by centralizing the configuration in the TCA.

Configure the page type in TCA 

To define the behavior and appearance of the new page type, create or edit Configuration/TCA/Overrides/pages.php.

Inherit configuration 

A custom page type usually shares the same fields as a standard page. Copying the configuration from doktype 1 ensures that all default tabs and fields are available. This inheritance must happen first.

Define record restrictions 

The allowedRecordTypes key defines which database tables are allowed on this page type. Setting this to ['*'] allows all tables, while specifying tables such as ['tt_content'] restricts it to those tables.

Assign icon identifier 

The icon for the page tree and page properties is assigned via an icon identifier in the typeicon_classes array. This identifier must be registered later in the Icon API.

EXT:my_extension/Configuration/TCA/Overrides/pages.php
<?php

defined('TYPO3') or die();

use TYPO3\CMS\Core\Schema\Struct\SelectItem;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

(function () {
    $customPageDoktype = '116';
    $customIconClass = 'tx-examples-archive-page';

    $GLOBALS['TCA']['pages']['types'][$customPageDoktype] = $GLOBALS['TCA']['pages']['types'][1];
    $GLOBALS['TCA']['pages']['types'][$customPageDoktype]['allowedRecordTypes'] = ['*'];
    $GLOBALS['TCA']['pages']['ctrl']['typeicon_classes'][$customPageDoktype] = $customIconClass;

    ExtensionManagementUtility::addTcaSelectItem(
        'pages',
        'doktype',
        new SelectItem(
            'select',
            label: 'LLL:EXT:examples/Resources/Private/Language/locallang.xlf:archive_page_type',
            value: $customPageDoktype,
            icon: $customIconClass,
            group: 'special',
        ),
    );
})();
Copied!

Register the icon via Icon API 

The identifier used in the TCA (tx-examples-archive-page) must be registered in Configuration/Icons.php to link it to an SVG file.

EXT:my_extension/Configuration/Icons.php
<?php

use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider;

return [
    'tx-examples-archive-page' => [
        'provider' => SvgIconProvider::class,
        'source' => 'EXT:examples/Resources/Public/Images/ArchivePage.svg',
    ],
];
Copied!

You can also provide icons for special states by registering additional identifiers with specific suffixes:

  • Page is hidden in navigation: tx-examples-archive-page-hideinmenu
  • Page is a root page: tx-examples-archive-page-root
  • Page contains content from another page: tx-examples-archive-page-contentFromPid

Enable drag and drop in the page wizard 

Deprecated since version 14.2

The User TSConfig option options.pageTree.doktypesToShowInNewPageDragArea has been marked as deprecated and will be removed in TYPO3 v15.0.

Use it if you want to be compatible with both TYPO3 v14 and v13.

The page tree toolbar submenu automatically determines available page types based on the users group permissions. No manual configuration is necessary.

Further information