Commit Graph

2 Commits

Author SHA1 Message Date
f18a57e83f feat(wpml): refactor to post_content + duplicate site in French via WPML
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>
2026-05-09 13:11:42 +02:00
773f137eb7 feat(home): build complete homepage and global templates
Scaffolds all components needed for the home and ships a working
front-page implementation covering the 9-section wireframe.

Components (assets/css/components.css)
- 13 sections per Design Handoff section 3:
  buttons, links, forms, cards (5 variants), stat callouts, header,
  nav, mega menu, drawer, footer, hero, logo strip, eyebrow,
  section title/lead, conversion banner, scroll reveal.
- All token-driven, prefixed `av-`, BEM-light. Mobile-first with
  768/1024/1280 breakpoints. Respects prefers-reduced-motion.

Global templates
- header.php: sticky header (60px mobile / 72px desktop), 5-item
  nav, language switcher, primary CTA, mobile drawer with hamburger
  toggle. Skip link first focusable element.
- footer.php: 5-column dark footer (Solutions, Industries, Why
  Asterion, Why Asterion, Newsletter), bottom strip with legal
  links + social.
- index.php: archive/search/blog fallback rendering posts in
  card-blog layout.
- front-page.php: full home with 9 sections, EN copy lifted
  verbatim from PDF Strategie D.1:
    1. Hero "Your Last Mistake Should Be in VR." + 2 CTAs
    2. Trust bar (placeholder logos + 4 inline metrics)
    3. Solutions: MY / FLEX / ACADEMY (3 cards)
    4. Industries: Police / SF / Military / Firefighters (2x2)
    5. Feature heroes: UWeD, Instructor Cockpit, AAR (alternating)
    6. Featured case study with 3 stat callouts
    7. Testimonials (3 quote cards)
    8. Latest insights (queries `post`; placeholder when empty)
    9. Conversion banner (Demo / T&E / Quote)

Verified: HTTP 200 on http://localhost:10004/, 73 KB HTML, 418 ms.

Outstanding (deferred)
- Hero video master + photographs (see MISSING-ASSETS.md)
- Mega menu content (links currently flat to section index)
- Form posts (newsletter currently no-op POST)
- Bricks license activation (manual, requires user key)
- WPML setup wizard (manual, requires user key)
- Lighthouse + axe full audit (visual env required)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 12:08:43 +02:00