feat(bricks+wpml): full programmatic page generation + native WPML CTE integration

Sessions 3-4 deliverables. Establishes the Asterion content pipeline :
EN pages generated programmatically from content-source/*-data.php, FR
translations rebuilt natively by Bricks's WPML integration from EN structure
+ WPML strings (no direct FR _bricks_page_content_2 writes).

## tools/_av-bricks-shared.php (the library)
Shared helpers + element atoms (eyebrow/heading/text/button/text-link) +
section builders (hero/prose/list/cards/cta/upsell/closer) + page write
pipeline that handles : write EN content via $wpdb (bypass Bricks's filter),
force Bricks::Elements::load_elements() so controls are populated, fire
wpml_page_builder_register_strings, push dict FR into icl_string_translations
(skip user CTE edits, auto-prefix /fr on internal URLs), trigger Bricks
native FR rebuild via wpml_page_builder_string_translated, and ensure a CTE
job exists (icl_translate_job.editor='wpml' + revision=NULL + populate
icl_translate rows with base64+gzip-encoded EN/FR strings).

## tools/av-generate-{industries,solutions}.php
Thin wrappers : URL trigger (template_redirect, not init — Bricks elements
load on 'wp' hook), add_filter('av_fr_translation_dict', ...) to register
FR strings, content-type-specific hub builder. ~150 FR strings per type.

## tools/av-translate-{industries,solutions}-fr.php
One-shot seeds for the initial FR linked posts via WPML trid mapping.

## tools/av-wpml-* operational mu-plugins
- set-cte : switch doc_translation_method to ICL_TM_TMETHOD_EDITOR (=1)
- create-jobs : reset CTE jobs (status=10 + needs_update=1 + editor=wpml +
  revision=NULL). Integrated into pipeline via av_ensure_wpml_cte_job().
- fix-status / repair : align FR posts to correct trid + cleanup orphans.
- push-translations : push dict into icl_string_translations.
- plugins-check / debug / dump-strings / icl-dump / rescan : diagnostics.

## tools/av-fix-link-types.php
One-shot DB migration : convert legacy link.type='internal'+url to 'external'
across all _bricks_page_*_2 meta values (JSON and PHP-serialized). Bricks's
set_link_attributes() only renders href= for type='external' — older session-3
templates lost their href silently.

## Other tools/ mu-plugins
- av-bricks-rest-bridge : pivot — exposes Bricks CPTs over REST, dual-format
  read filter (JSON for MCP / array for renderer), auto-mirror content→header/
  footer for templates.
- av-apply-bricks-styles, av-cleanup-orphans, av-create-wp-menu, av-debug-meta,
  av-dump-bricks, av-fix-template-meta : misc operational scripts.

## Bricks Config/
JSON snapshots of bricks_theme_styles, bricks_color_palette,
bricks_global_settings for diffable inspection.

## .gitignore
Add .mcp.json — holds per-developer WP App Password for the Bricks MCP server.

## wp-content/themes/asterion-bricks/assets/css/utilities.css
Note that all responsive overrides are now emitted natively by the page
generator via Bricks per-breakpoint settings, no custom CSS needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-14 19:40:28 +02:00
parent af0ed66122
commit d2badf49d4
28 changed files with 4305 additions and 1 deletions

View File

@@ -0,0 +1,96 @@
{
"id": "44a09f",
"name": "Default",
"colors": [
{
"light": "#f5f5f5",
"raw": "var(--bricks-color-grey-100)",
"id": "ab2156"
},
{
"light": "#e0e0e0",
"raw": "var(--bricks-color-grey-300)",
"id": "664644"
},
{
"light": "#9e9e9e",
"raw": "var(--bricks-color-grey-500)",
"id": "eec8d2"
},
{
"light": "#616161",
"raw": "var(--bricks-color-grey-700)",
"id": "68168c"
},
{
"light": "#424242",
"raw": "var(--bricks-color-grey-800)",
"id": "5ce47e"
},
{
"light": "#212121",
"raw": "var(--bricks-color-grey-900)",
"id": "f5049f"
},
{
"light": "#ffeb3b",
"raw": "var(--bricks-color-yellow)",
"id": "9d011c"
},
{
"light": "#ffc107",
"raw": "var(--bricks-color-amber)",
"id": "dacd30"
},
{
"light": "#ff9800",
"raw": "var(--bricks-color-orange)",
"id": "3bcffd"
},
{
"light": "#ff5722",
"raw": "var(--bricks-color-deep-orange)",
"id": "2ce1e9"
},
{
"light": "#f44336",
"raw": "var(--bricks-color-red)",
"id": "57b992"
},
{
"light": "#9c27b0",
"raw": "var(--bricks-color-purple)",
"id": "5825c2"
},
{
"light": "#2196f3",
"raw": "var(--bricks-color-blue)",
"id": "0e5dd9"
},
{
"light": "#03a9f4",
"raw": "var(--bricks-color-light-blue)",
"id": "f5d57b"
},
{
"light": "#81D4FA",
"raw": "var(--bricks-color-sky-blue)",
"id": "7dd108"
},
{
"light": "#4caf50",
"raw": "var(--bricks-color-green)",
"id": "5c8f35"
},
{
"light": "#8bc34a",
"raw": "var(--bricks-color-light-green)",
"id": "432723"
},
{
"light": "#cddc39",
"raw": "var(--bricks-color-lime)",
"id": "25a3a8"
}
]
}