Processes that happen during content block registration¶
To achieve the goal of reducing the complexity of content block registration the facade pattern approach needs to be used for some of TYPO3s internal APIs. These are
- Mapping to the database
- TCA generation for
- registration of the icon in the CType field in TCA
- Registration of the plugin to display the content for frontend rendering including DataProcessors
- Registration of the icon in the new content element wizard (PageTS)
- Configuration of the template path(s)
- Registration for the preview in the backend
Processes in detail¶
Detecting a content block¶
The detection of content blocks depends on the composer package type. The custom composer installer then retrieves all packages, which are of the above defined type.
Validating a content block¶
Not yet implemented! See validation of package files and validation of the editing interface. Basically a YAML schema validation (based on JSON schema) is needed here. Exchange with the Form Framework team is targeted.
If a content block is invalid, it won’t be available in the TYPO3 backend for editors. An error message is available in the “Check for broken content blocks” tool in the maintenance area. Additional information to composer could be added via a composer plugin to validate the definition during installation.
Mapping to the database¶
There are several variants of how data of a content block can be stored and retrieved from the database. Currently, there is no decision on the desired storage method, because performance research is still in progress.
Virtual generation of TCA (ext_tables.php)¶
- Has to be after non override TCA loading
- Has to be before the caching of the TCA
- Has to be before merging the overrides for TCA
TCA is virtually generated from the class implementing a content block field type.
Generate registration of the plugin¶
- Register icon
- Add TCA entry in CTypes list including the icon
- Register plugin in TYPO3
- Add TypoScript to render the content plugin
- Add PageTS for the content block
- Define where to display (group / location) the content block in the new content element wizard