Developer Guide
Adding a new content element
Use the scaffold CLI — it generates every required file and patches all registration files automatically.
Local (Node.js installed on host), from vendor/:
npm run make-element
This works out of the box wherever the package is installed, since the
script (bin/) ships inside connetation/
itself.
Optional: a DDEV host command
Important
Unlike npm run make-, the ddev make- shortcut is
not part of the connetation/ package — it is a project-level
DDEV host command that must exist in your own project's
.ddev/. Installing connetation/
via Composer into a fresh project does not give you this command; you
need to add the script yourself before ddev make- will
work.
To add it:
- Create the file
.ddev/at the root of your TYPO3 project (create thecommands/ host/ make- element hostdirectory too if it doesn't exist yet — note this is a project-level DDEV directory, not part ofconnetation/).t3wtk- elements -
Paste in the following script:
#!/usr/bin/env bash ## Description: Scaffold a new content element in connetation/t3wtk-elements ## Usage: make-element ["Element Name"] ## Example: ddev make-element ## Example: ddev make-element "Hero Banner" set -euo pipefail ARGS="$*" if [ -n "$ARGS" ]; then ddev exec bash -c "cd /var/www/html/vendor/connetation/t3wtk-elements && node bin/make-element.mjs '$ARGS'" else ddev exec bash -c "cd /var/www/html/vendor/connetation/t3wtk-elements && node bin/make-element.mjs" fiCopied! -
Make it executable — DDEV silently ignores host commands that aren't:
chmod +x .ddev/commands/host/make-elementCopied! -
Restart DDEV so it picks up the new command:
ddev restartCopied!(
ddev restartis only needed the first time you add a new host command; editing an existing one afterwards does not require a restart.)
/var/ is DDEV's default in-container path for the project
root, so this script works unmodified on any standard DDEV setup. If your
project customises the web container's document/project root, adjust that
path accordingly.
Once that host command is in place, you can run:
ddev make-element
Or pass the element name directly to skip the first prompt:
ddev make-element "Hero Banner"
The host command itself is a thin wrapper that opens an interactive
terminal inside the web container (ddev exec -) and runs
node bin/ from vendor/, so
readline prompts work correctly; running plain ddev exec without
-it would hang waiting for input.
Either way you invoke it, the scaffold CLI asks three questions:
- Element name — e.g.
Hero Banner,Testimonial,Pricing Table - Type — Simple (FlexForm settings only) or With inline child records (like Accordion / Cards)
- CE group —
conn_,bootstrap conn, orconn_swiper
What gets generated
| File | Purpose |
|---|---|
Configuration/ | Display settings form |
Configuration/ | Frontend rendering setup |
Configuration/ | Child record TCA (with-items only) |
Classes/ | DB query + FlexForm resolver (with-items only) |
Resources/ | Main Fluid template |
Resources/ | Item partial (with-items only) |
Resources/ | SCSS entry point |
Resources/ | SCSS component |
Resources/ | TypeScript component |
Resources/ | Icon placeholder (replace with real SVG) |
What gets patched automatically
Configuration/Icons.php, build., ext_tables.sql,
ext_localconf.php, Configuration/TCA/Overrides/tt_content.php,
Resources/,
Configuration/TypoScript/setup.typoscript.
All patches are idempotent — re-running the script on an existing element name is safe.
After running the scaffold
These steps must be done in order — skipping or reordering them causes an "Unknown column" SQL error when saving the element in the backend.
- Build assets —
npm run buildlocally, or via DDEV as above. - Flush TYPO3 caches — Admin Tools > Maintenance > Flush all caches, so TYPO3 picks up the new TCA and SQL definitions.
- Apply database schema (with-items elements only) — Admin Tools >
Maintenance > Analyze Database Structure > apply changes. Skipping
this step leaves the new column missing from the database, causing a
SQL error: Unknown column '...' in 'INSERT INTO'when saving. - Verify — the element should now appear in the "New Content Element" wizard under the chosen group.
Customising the generated element
- FlexForm — edit
Configuration/to add or change display settings.Flex Forms/<Name>. xml - Child record fields — extend
Configuration/andTCA/ tx_ conn_ t3wtk_ elements_ domain_ model_<name>_ item. php ext_, then re-run database analysis.tables. sql - Data Processor — extend
resolveand theSettings () $rowsenrichment in the generated processor. - Template — edit the Fluid template and partial freely.
- SCSS — edit
_<name>.; usesscss vardesign tokens for consistent theming.(-- conn-*) - TypeScript — edit
<name>.; thets registry.call at the bottom wires it to the DOM.register () - Icon — replace
Resources/with your SVG (16×16 viewBox recommended).Public/ Icons/<name>- ce. svg