TAW Gutenberg — the TAW block theme
TAW Gutenberg is TAW's block (full site editing) theme. Presentation is plain Gutenberg, and the data layer (post types, taxonomies, fields, options) comes from taw/core.
What it is
TAW Gutenberg is the TAW theme for block-editor sites. It splits the work cleanly:
- Presentation is plain Gutenberg:
theme.json,templates/*.htmlandparts/*.html, all editable in the Site Editor. There are no PHP templates and no JS build. - Data comes from taw/core: post types, taxonomies, fieldsets and options pages defined as JSON in
taw-schema/, booted with\TAW\Core\Boot::data(). See the Data layer page.
Use TAW Theme for classic, component-built sites (PHP blocks, Vite, Tailwind, Alpine), and TAW Gutenberg when the site is built in the block editor. Both themes read the same data the same way.
TAW Gutenberg requires PHP 8.2+ and WordPress 6.6+. It's developed against WordPress 7.1.
Install
Create the theme
Run the TAW installer with the Gutenberg starter. It installs the theme and its dependencies in my-theme/:
cd wp-content/themes
TAW_STARTER=gutenberg composer create-project taw/create my-theme \
--repository='{"type":"vcs","url":"https://github.com/Relmaur/taw-create"}'
Without TAW_STARTER, the installer asks which TAW theme you want. The package also installs directly: composer create-project taw/gutenberg my-theme --repository='{"type":"vcs","url":"https://github.com/Relmaur/taw-gutenberg"}'.
Activate the theme
Activate TAW Gutenberg in Appearance → Themes. If composer install hasn't run yet, the site still renders, and administrators see a notice asking for it.
Define your data
Edit the JSON files in taw-schema/. The theme ships a working example (a book post type, a genre taxonomy and a book_details fieldset). Check your changes without WordPress:
php bin/taw schema:validate
How it's built
| Path | Purpose |
|---|---|
theme.json, templates/, parts/ | All presentation |
functions.php | Loads Composer and registers the theme's services |
app/Setup/TawData.php | Calls \TAW\Core\Boot::data() at after_setup_theme |
taw-schema/*.json | Your content model |
bin/taw | schema:validate |
Every service implements a small Bootable contract whose register() only adds WordPress hooks.
That keeps the theme unit-testable without WordPress. CI runs PHPStan at level max, the unit tests,
and schema:validate.
Namespace your field ids by entity (book_author, not author). taw/core's field registry is keyed by bare id, so two fields both named author would collide.
What's next
Block Bindings (bind core blocks to taw fields in templates), a loop block, and per-post-type editing policies are on the taw/core roadmap. TAW Gutenberg adopts each one first.