This API provides an easy and reliable way to register content blocks (composer packages). See Content Blocks Registration in TYPO3 for more information about content blocks.
alpha
- the main concepts are laid out but nothing is polished yet. We welcome your feedback.
You can reach us in the TYPO3 Slack #cig-structuredcontent-contentblockcreation
❤️.
This will set up a TYPO3 v10 and install the API extension.
It is a quickstart to explore the feature, too.
- clone this repository
ddev launch /typo3
The TYPO3 backend user is "admin", password "adminadmin".
It includes example Content Blocks in a local composer repository that are installed by default.
- TYPO3 v10+
- In TYPO3 v10, backend previews require the Fluid based Page module to be enabled.
This installs the API required to use content blocks. It consists of 2 composer packages: an API extension and a composer plugin.
composer config repositories.cb-reg-api vcs https://github.com/TYPO3-Initiatives/content-block-registration-api.git composer config repositories.cb-composer-plugin vcs https://github.com/TYPO3-Initiatives/content-blocks-composer-plugin.git composer config minimum-stability dev composer req typo3-contentblocks/contentblocks-reg-api:dev-master
- Add new database fields: (Backend)
Maintenance
›Analyze Database Structure
This is an example repo with a content block
composer config repositories.cb-examples vcs https://github.com/TYPO3-Initiatives/content-block-examples.git composer req typo3-contentblocks/call-to-action-example:dev-master
For using custom content blocks in your project we recommend a local "path" composer repository.
There is a wizard module that kickstarts Content Blocks for you.
You can also add a Content Block directory manually to typo3conf/contentBlocks
.
The detection of content blocks depends on the composer package type.
The custom composer installer then retrieves all packages, which are of type typo3-cms-contentblock
.
Following aspects are mandatory for a content block to be validated successfully:
- An icon for the content block named "ContentBlockIcon" hast to be present in the package root and of type SVG/PNG/GIF
- The file
EditorInterface.yaml
has to be present in the package root and valid - The backend language file
Default.xml
orEditorInterface.xlf
has to be present in thesrc/Language
folder of the package - The file
EditorPreview.html
has to be present in thesrc
folder of the package
Content blocks are stored in or symlinked to typo3conf/contentBlocks/
.
TCA is virtually generated from the class implementing a content block field type.
Based on the fields defined in the EditorInterface.yaml
a FlexForm for the editing interface of the content block
is generated and stored in tt_content.content_block
.
- Register icon
- Add TCA entry in CTypes list including the icon
- Add the content block to the NewContentElementWizard
- Add TypoScript to render the content plugin
- Add PageTS for the content block