gTemplate

Geodineum

gTemplate

The WordPress parent theme of a Geodineum site: it owns the operational backbone - gCore framework wiring, gNode connectivity, three-tier rendering, the REST API, WP-CLI, and the customizer - so child themes contribute only visual identity and geometry.

Built by Niels Erik Toren · WordPress parent theme, geodineum/gtemplate-wp (Composer); version in style.css


What it is

gTemplate is a PHP parent theme built on the gCore MU-plugin framework. A site runs gCore → gTemplate → child theme: gCore provides the service container and the gNode transport, gTemplate provides everything a site needs to render and integrate, and a child theme (gCube, or a custom one) supplies just the geometry and look.

It degrades gracefully. The renderer falls through three tiers - a pre-rendered bundle, a gNode-rendered template, then server-side PHP - so when gNode or ValKey is unreachable the site still renders from WordPress data, losing only the cached fast paths. A child theme never has to know which tier served a face.

Public build surface

What you build against as a child theme is the filter and action contract - the gtemplate_* hooks gTemplate exposes for a child to parameterize rendering, navigation, the customizer, SEO, and more. That contract has one home: FILTER_REGISTRY.md - every public hook with its arguments, default, and expected return shape. A hook present in code but not listed there is private and may change without notice.

The other integration points a site or extension builds against - the /wp-json/gtemplate/v1/ REST API, the [gbtn] / [gform] shortcodes and their capture stream, and the PHP config helpers - are specified in CONTRACT.md.

FILTER_REGISTRY.md is kept honest by a checker: php scripts/check-filter-registry.php verifies every documented hook is still fired in the code, so a rename or removal can't silently break child themes.

Internal - everything under inc/ (the bootstrap, renderer, sync layer, integrations, and CLI) is implementation and may change.

Capabilities

Contract

The precise integration surface - REST routes, the COMMS and [gform] capture stream producers, wire formats, config keys, and PHP helper signatures - is in CONTRACT.md. Agents should prime from CONTRACT.scn.md. The child-theme hook contract is FILTER_REGISTRY.md.

Quick start

You build on gTemplate from a child theme, parameterizing the parent through its public hooks:

// In a child theme's functions.php - see FILTER_REGISTRY.md for every hook.
add_filter('gtemplate_face_count', fn() => 8);   // this geometry has 8 faces, not 6

add_filter('gtemplate_content_sources', function (array $sources) {
    $sources['gallery'] = fn(int $face_id) => my_render_gallery($face_id);
    return $sources;
});

add_action('gtemplate_register_customizer_sections', function ($wp_customize) {
    // register the child theme's own customizer sections/controls here
});

Operate an installed site through WP-CLI and the Geodineum CLI:

wp gtemplate status --path=/var/www/mysite    # registration status
geodineum template contract                   # print the integration contract
sudo geodineum cache stats                    # page-cache key counts

Limits worth knowing

Collaborate

Contributions are welcome. Open issues and pick up work on the ecosystem board at geodineum.com; issues tagged good-first-issue are a good place to start.

Author & support

Built by Niels Erik Toren.

If you want to support the work:

Currency Address
Bitcoin (BTC) bc1qwf78fjgapt2gcts4mwf3gnfkclvqgtlg4gpu4d
Ethereum (ETH) 0xf38b517Dd2005d93E0BDc1e9807665074c5eC731 / nierto.eth
Monero (XMR) 8BPaSoq1pEJH4LgbGNQ92kFJA3oi2frE4igHvdP9Lz2giwhFo2VnNvGT8XABYasjtoVY2Qb3LVHv6CP3qwcJ8UnyRtjWRZ5

Disclaimer

This software is provided "as is", without warranty of any kind, express or implied. Use of this software is entirely at your own risk. In no event shall the author or contributors be held liable for any damages arising from the use or inability to use this software.

License

Licensed under either of

at your option.