This commit makes the site editable from WP admin (Gutenberg or Bricks "Edit with Bricks") and translatable via WPML Translation Editor by shifting page rendering away from Custom Templates and into post_content. Architecture change ------------------- Before: Custom Templates assigned to each page (page-solution-detail.php etc.) generated the page HTML at runtime by reading from inc/*-data.php arrays. WPML had nothing to translate, Bricks Builder had nothing to edit, the client could only modify content by editing PHP. After: - Pages now hold their full Gutenberg HTML inside post_content - The default page.php template renders the_content() — no Custom Templates assigned anymore - Bricks Builder picks up post_content and converts it to its element tree when "Edit with Bricks" is clicked - WPML Translation Editor exposes every block for translation - The client can edit pages directly in WP admin What this commit ships ---------------------- - inc/render-blocks.php: data array → Gutenberg HTML payload generator with helpers per section type (prose / cards / list / cta) and per page archetype (solution / industry / technology / editorial / form / overview hub). - inc/shortcodes.php: [av_form slug="request-demo"] for dynamic form blocks (forms can't live as static HTML — they need nonces and per-request state). - inc/i18n.php: av_lang() / av_t() helpers for inline string translation in header.php and footer.php (covers ~80 UI strings); switches based on WPML's wpml_current_language filter. - page.php: minimal default template — get_header() + the_content() + get_footer(). - header.php: real WPML language switcher driven by wpml_active_languages filter (replaces the placeholder EN · FR toggle); UI strings now route through av_t(). - footer.php: same UI string treatment. - Custom Templates retained but no longer assigned (pages were stripped by the migration mu-plugin); they remain available if a page wants to opt back into the data-file pattern. Operational migrations (one-shot mu-plugins, not versioned) ----------------------------------------------------------- 1. asterion-migrate-to-blocks.php walked all 26 PHP-templated pages, pre-rendered them via the new render-blocks helpers, wrote the result to post_content, and stripped _wp_page_template. 2. asterion-duplicate-fr.php cloned all 35 pages into French via WPML API, preserved parent/child hierarchy, linked translations through the trid table, marked them as duplicates pending refinement. 3. asterion-fix-fr-slugs.php aligned French slugs with English ones (WP's wp_unique_post_slug() had appended -2 suffixes; we bypass via $wpdb->update so /fr/solutions/ resolves correctly). Verified -------- - All 35 EN URLs return HTTP 200 - All 35 FR URLs return HTTP 200 under /fr/<slug>/ - Language switcher in header outputs correct hreflang links - WPML emits hreflang en / fr / x-default in <head> - Body class confirms wp-child-theme-asterion-bricks active - Bricks frontend CSS still enqueued - Inter Variable still preloaded Next steps ---------- - French content is currently the duplicated EN copy. Translate via WP admin → WPML → Translation Editor (per-block UI), or edit pages directly in /fr/<slug>/ via Gutenberg / Bricks - WPML String Translation can scan the theme to surface av_t() / __() strings for UI-level translation overrides Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Asterion Bricks — Child theme
Custom WordPress child theme for asterionvr.com, built on top of Bricks Builder. Tactical-cinematic design system for the PROSERVE XR training platform.
Structure
asterion-bricks/
├── style.css # WP theme metadata only (CSS lives in assets/css/)
├── functions.php # enqueues, theme support, includes
├── theme.json # Gutenberg color/typo palette
├── assets/
│ ├── css/
│ │ ├── tokens.css # design tokens — source of truth
│ │ ├── utilities.css # CSS reset + utility classes (.av-container, etc.)
│ │ └── components.css # component styles (buttons, cards, header, footer…)
│ ├── js/
│ │ └── main.js # vanilla JS, defer-loaded
│ ├── fonts/ # self-hosted Inter (RGPD)
│ └── img/ # static visuals
├── templates/ # Bricks template JSON exports (versioned)
└── inc/
├── cpt.php # custom post types: case_study, scenario
└── seo.php # Schema.org JSON-LD overrides
Conventions
- CSS prefix :
av-(asterion-vr) on every custom selector to avoid collision with Bricks classes. - BEM-light naming :
.av-card,.av-card--feature,.av-card__icon,.av-card.is-loading. - Zero hardcoded values — every color, spacing, radius and duration goes through
tokens.css. - JS : vanilla, defer-loaded, prefer
IntersectionObserverover scroll listeners. - A11y : keyboard reachable,
:focus-visibleoutline, ARIA where needed, contrast ≥ 4.5:1,prefers-reduced-motionrespected.
Activation
- Ensure Bricks parent is installed at
wp-content/themes/bricks/. - WP Admin → Appearance → Themes → activate Asterion Bricks.
Performance budget (per BRIEF section 9)
| Asset | Budget |
|---|---|
| HTML initial | < 100 KB gzipped |
| CSS total | < 50 KB gzipped |
| JS initial | < 200 KB gzipped |
| Hero video | < 2 MB |
| Hero poster | < 150 KB |
| LCP / CLS / TBT | < 2.5s / < 0.1 / < 200ms |
License
GPL v2 or later. Same as WordPress core.