Jump to content

Backend

TYPO3 backend integration for mpc/mp-core: Page TSconfig, RTE preset, backend CSS, content previews, backend layouts, and editor-facing PHP helpers.

MP-Core logo

Overview

AreaLocationPurpose
Page TSconfigConfiguration/Sets/mp-core-page/page.tsconfigLoaded via Site Set; imports all backend/editor TSconfig
RTE presetConfiguration/RTE/Default.yamlRegistered as global preset default in ext_localconf.php
Backend CSSResources/Public/StyleSheets/backend.cssTYPO3 backend UI tweaks (Vite entry backend.js)
CKEditor CSSResources/Public/StyleSheets/ckeditor.cssWYSIWYG appearance in backend + frontend RTE output
CKEditor pluginResources/Public/JavaScripts/ckeditor/definition-list.jsDefinition list toolbar plugin
Preview rendererClasses/Preview/CustomContentPreviewRenderer.phpPage module content previews
Backend layoutsConfiguration/TsConfig/Page/Mod/WebLayout/BackendLayouts/Web > Page colPos structure
Form YAMLResources/Extensions/form/Yaml/BaseSetup.yamlEXT:form styling (when form is loaded)

Page TSconfig

Registered through the Site Set (Configuration/Sets/mp-core-page/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

Editor-facing form behaviour for pages and tt_content:

  • Pages: layout — only “Standard” (items 1–4 removed).
  • Content: hides unused core CTypes (bullets, several menu_*, textmedia, table, …).
  • Headers: extended header_layout labels (items 6–12); default TYPO3 layout 0 removed.
  • Frames: frame_class and linkToTop disabled globally.
  • Per-CType overrides (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 permission flags for new content (group/user edit rights).

Content element wizards

Configuration/TsConfig/Page/ContentElement/Element/*.tsconfig registers New content element wizard entries:

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

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

Backend layouts

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

LayoutFileTypical colPos
DefaultDefault.tsconfig4 (logos top), 0 (top), 1 (main), 2 (bottom)
ArticleArticle.tsconfigArticle-specific regions

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';
 

Page TSconfig selects the preset:

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

Tag remapping in the same file: b → strong, i → em, s → del (RTE and DB parser).

Stylesheets

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

Rebuild with npm run build in Build/ after SCSS changes.

Preset highlights (Configuration/RTE/Default.yaml)

  • contentsCss: ckeditor.css — editor reflects frontend typography/buttons.
  • Toolbar: headings, styles, language, lists (incl. definition list), tables, source editing, etc.
  • Style plugin: Bootstrap buttons, kicker/lead, blockquote, headline level classes, link type classes, text utilities.
  • List properties: custom styles, start index, reversed order.
  • Definition list plugin: custom module @mpc/mp-core/ckeditor/definition-list.js (see Configuration/JavaScriptModules.php).
  • Allowed link classes: internal-link, external-link, download, email, phone, audio, video, glossary, public, legal, gallery, chart.
  • Processing: extra allowed 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 HTML sanitization and wrapping on the frontend.

Content preview (CustomContentPreviewRenderer)

Registered globally on tt_content:

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

Behaviour:

  • Delegates to TYPO3’s StandardContentPreviewRenderer when possible.
  • Catches TypeError from core preview utilities (missing file refs, null sanitization) and renders a fallback: optional 150×150 image thumb, header, subheader, bodytext excerpt (200 chars).
  • Implements LoggerAwareInterface. Every caught throwable is logged at warning level with method, uid, pid, CType, and the exception, so upstream regressions stay visible in the TYPO3 log instead of being masked by the fallback.
  • Intended as a temporary workaround until core preview edge cases are fixed.

PHP backend helpers

ClassRole
UserFunc\ColorPickerValueItemsitemsProcFunc for grid_bgcolor -- builds colour options from site config color-* keys. Filters values through Service\CssColorValidator and caps labels at 200 chars so malformed configs cannot pollute the BE select.
Service\CssColorValidatorPure static validator for CSS <color> tokens (named, #rgb[a], #rrggbb[aa], rgb()/rgba()/hsl()/hsla()); rejects any byte that could break out of a CSS declaration. Reused by Format\CssColorViewHelper.
Backend\Form\Container\FilesControlContainerFile field container; forwards fieldInformation to child fields
Preview\CustomContentPreviewRendererSee above

Registered in Configuration/Services.yaml (ColorPickerValueItems is public: true so TYPO3 can resolve the itemsProcFunc callback from the container). See Configuration → Dependency Injection for the full list and the local-overrides pattern.

Content Blocks (backend editor)

Definition list — ContentBlocks/ContentElements/definitionlist/

ItemValue
namedl/definitionlist
typeNamedefinitionlist
Grouplists

Fields (Content Blocks schema):

FieldTypeNotes
TYPO3/HeaderBasicReuses core header fields
radioboxesRadio0 = below each other, 1 = side by side
itemCollectionTerm (text) + definition (textarea, RTE enabled)
TYPO3/AppearanceBasicFrames, spacing

Templates:

  • Frontend: templates/frontend.html
  • Backend preview: 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, …) used in the new-content wizard and page tree.

Share page