Jump to content

Backend

TYPO3 backend integration for mpc/mp-core: TSconfig page, RTE preset, backend CSS, content preview, backend layouts and PHP helper for the editor.

MP-Core logo

Overview

SectionLocationPurpose
Page TSconfigConfiguration/Sets/mp-core/page.tsconfigLoaded via Site Set; imports all backend/editor TSconfig files
RTE presetConfiguration/RTE/Default.yamlRegistered as a global preset default in ext_localconf.php
Backend CSSResources/Public/StyleSheets/backend.cssTYPO3 backend UI customisations (Vite entry backend.js)
CKEditor CSSResources/Public/StyleSheets/ckeditor.cssWYSIWYG display in the backend + RTE output in the frontend
CKEditor pluginResources/Public/JavaScripts/ckeditor/definition-list.jsPlugin for the definition list toolbar
Preview rendererClasses/Preview/CustomContentPreviewRenderer.phpPreview of page module content
Backend layoutsConfiguration/TsConfig/Page/Mod/WebLayout/BackendLayouts/Web > Structure of column positions on the page
Form YAMLResources/Extensions/form/Yaml/BaseSetup.yamlEXT:Form styling (when form is loaded)

TSconfig page

Registered via the Site Set (Configuration/Sets/mp-core/page.tsconfig):

 
@import 'EXT:mp_core/Configuration/TsConfig/Page/ContentElement/All.tsconfig'
@import 'EXT:mp_core/Configuration/TsConfig/Page/Mod/WebLayout/BackendLayouts.tsconfig'
@import 'EXT:mp_core/Configuration/TsConfig/Page/RTE.tsconfig'
@import 'EXT:mp_core/Configuration/TsConfig/Page/TCADefaults.tsconfig'
@import 'EXT:mp_core/Configuration/TsConfig/Page/TCEMAIN.tsconfig'
@import 'EXT:mp_core/Configuration/TsConfig/Page/TCEFORM.tsconfig'
 

TCEFORM.tsconfig

Form behaviour for the editor for pages and tt_content:

  • pages: layout — ‘Standard’ only (elements 1–4 removed).
  • Content: Hides unused core CTypes (bullets, multiple menu_*, textmedia, table, …).
  • headers: extended header_layout labels (items 6–12); standard TYPO3 layout 0 removed.
  • Frames: frame_class and linkToTop disabled globally.
  • Overrides per CType (e.g. menu_subpages link fields) – see file for full list.

TCADefaults.tsconfig

Default values when creating records, e.g. tt_content.filelink_size = 1, imagecols = 1.

TCEMAIN.tsconfig

default authorisation flags for new content (editing rights for groups/users).

Wizards for content elements

Configuration/TsConfig/Page/ContentElement/Element/*.tsconfig registers new entries in the Content Element Wizard:

FileCType
Gallery.tsconfiggallery
Stage.tsconfigstage
Banner.tsconfigbanner
Singleteaser.tsconfigsingleteaser

Container CTypes (ce_*) are registered by b13/container TCA, not via separate wizard TSconfig files.

Backend layouts

Mod/WebLayout/BackendLayouts/Default.tsconfig and Article.tsconfig define the column structure for the page module:

LayoutFileTypical column positions
DefaultDefault.tsconfig4 (logos at the top), 0 (top), 1 (main area), 2 (bottom)
ArticleArticle.tsconfigArticle-specific areas

SVG icons: Resources/Public/BackendLayouts/.

RTE (CKEditor 5)

Registration

 
// ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['default'] = 'EXT:mp_core/Configuration/RTE/Default.yaml';
 

The TSconfig page selects the default setting:

 
// Configuration/TsConfig/Page/RTE.tsconfig
RTE.default.preset = default
 

Tag remapping in the same file: bstrong, iem, sdel (RTE and DB parser).

Stylesheets

ConstantFile
BE.stylesheets.mp_core_backendResources/Public/StyleSheets/backend.css
BE.stylesheets.mp_core_ckeditorResources/Public/StyleSheets/ckeditor.css

Create new with npm run build after Build/ SCSS changes.

Default highlighting (Configuration/RTE/Default.yaml)

  • contentsCss: ckeditor.css — The editor reflects the front-end typography and buttons.
  • Toolbar: Headings, Styles, Language, Lists (including definition lists), Tables, Source code editing, etc.
  • Style plugin: Bootstrap buttons, kicker/lead, block quotes, classes for heading levels, classes for link types, text helper functions.
  • List properties: custom styles, starting index, reverse order.
  • Definition list plugin: custom module @mpc/mp-core/ckeditor/definition-list.js (see Configuration/JavaScriptModules.php).
  • Permitted link classes: internal-link, external-link, download, email, phone, audio, video, glossary, public, legal, gallery, chart.
  • Processing: additional permitted tags (figure, figcaption, dl, dt, dd, …).

Labels: Resources/Private/Language/locallang_rte.xlf.

Frontend RTE output

TypoScript lib.parseFunc_RTE in Configuration/TypoScript/Setup/60.Lib.typoscript and 90.CleanupRTE.typoscript Control of HTML sanitisation and line breaks in the frontend.

Table of contents (CustomContentPreviewRenderer)

Registered globally under tt_content:

 
// Configuration/TCA/Overrides/tt_content_00_base.php
$GLOBALS['TCA']['tt_content']['ctrl']['previewRenderer'] =
    \Mpc\MpCore\Preview\CustomContentPreviewRenderer::class;
 

Behaviour:

  • Delegated to TYPO3’s StandardContentPreviewRenderer where possible.
  • Detects TypeError from the core preview tools (missing file references, null sanitisation) and renders a fallback: optional 150×150 image thumbnail, header, subheader, text excerpt (200 characters).
  • Intended as a temporary solution until edge cases in the core preview are resolved.

PHP Backend Helpers

ClassRole
UserFunc\ColorPickerValueItemsitemsProcFunc for grid_bgcolor — Creates colour options from the website configuration color-* Key
Backend\Form\Container\FilesControlContainerFile field container; passes fieldInformation to child fields
Preview\CustomContentPreviewRendererSee above

Registered in Configuration/Services.yaml (ColorPickerValueItems is public: true for TCA callbacks).

Content blocks (backend editor)

Definition list — ContentBlocks/ContentElements/definitionlist/

ElementValue
namedl/definitionlist
typeNamedefinitionlist
Groupslists

Fields (content block schema):

FieldTypeNotes
TYPO3/HeaderBasicUses core header fields
radioboxesRadio0 = one below the other, 1 = side by side
itemCollectionTerm (text) + Definition (textarea, RTE enabled)
TYPO3/AppearanceBasicBorders, spacing

Templates:

  • Frontend: templates/frontend.html
  • Preview in the backend: templates/backend-preview.html

Content blocks are provided by friendsoftypo3/content-blocks (Composer dependency).

Icons

Configuration/Icons.php registers SVG icons for CTypes and containers (tx_gallery, tx_stage, ce_accordion, …) are registered for use in the New Content wizard and the page tree.

Related documentation

Share page