feat(pages): generate Phases 8-11 — Technology + Editorial + Forms + Home

Brings the site to its full programmatic page count : 24 EN + 24 FR pages
(48 total), all wired into the WPML CTE workflow established in the previous
commit. Each phase reuses tools/_av-bricks-shared.php builders, adds its own
filter('av_fr_translation_dict') to extend the FR dictionary, and ships a
seed-FR mu-plugin for the initial WPML trid linking.

## Phase 8 — Technology (tools/av-generate-technology.php + seed)
Hub /technology/ + 6 pillar pages (vr-hardware, software-ai, weapons-tracking,
scenarios, instructor-cockpit, after-action-review). Hub uses a 6-card grid
(3+3 layout — added card_count=6 case in av_build_cards_section).
EN : 87-93. FR : 94-100.

## Phase 9 — Editorial (tools/av-generate-editorial.php + seed)
5 top-level pages : /why-asterion/, /about/, /customers/, /trust/, /partners/.
Required adding empty-parent-path support to av_upsert_detail_page() so pages
can be created at the site root (no hub). EN : 107-111. FR : 112-116.

## Phase 10 — Forms (tools/av-generate-forms.php + seed)
4 conversion pages : /request-demo/, /request-te-kit/, /request-quote/,
/contact/. Custom page builder (not the shared detail-page pattern) :
hero + 2-column section (Bricks `form` element on left, promise list on
right) + optional shortcuts row (Contact), eligibility list (T&E Kit), FAQ
accordion (Demo). Form actions=email, emailTo=hello@asterionvr.com.
Field labels, select options, FAQ Q&A all in the FR dict.
EN : 122-125. FR : 126-129.

## Phase 11 — Home page (tools/av-generate-home.php + seed)
Custom-written single page (no data file). Sections : hero + 3-pillar cards
(Operational reality / Modular / Sovereign) + 4 Industries cards + 4
Solutions cards + 4-stat numbers band + Why-Asterion teaser CTA + Customers
teaser CTA + custom navy closer. Set as WP static front via
update_option(show_on_front=page, page_on_front=ID).
EN : 134. FR : 135.

## tools/_av-bricks-shared.php
- av_upsert_detail_page() now accepts empty `$parent_path` → top-level page
- av_build_cards_section() handles card_count=6 → 3-per-row layout

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-14 19:58:48 +02:00
parent d2badf49d4
commit 38c0c5031e
9 changed files with 1500 additions and 6 deletions

View File

@@ -0,0 +1,59 @@
<?php
/**
* Plugin Name: Asterion — Seed FR translations for Technology (one-shot)
* Description: /?av_translate_technology_fr=1 creates the FR linked posts for
* the Technology hub + 6 detail pages. Run after ?av_generate_technology=1,
* then re-run ?av_generate_technology=1 to push translated structure.
*/
defined('ABSPATH') || exit;
require_once __DIR__ . '/_av-bricks-shared.php';
add_action('template_redirect', function () {
if (empty($_GET['av_translate_technology_fr'])) return;
if (! in_array($_SERVER['SERVER_NAME'] ?? '', ['localhost', '127.0.0.1'], true)) wp_die('localhost only');
header('Content-Type: text/plain; charset=utf-8');
$hub = get_page_by_path('technology');
if (! $hub) {
echo "FAIL : /technology/ hub not found. Run ?av_generate_technology=1 first.\n";
exit;
}
$fr_titles = [
'technology' => 'Technologie',
'vr-hardware' => 'Matériel VR',
'software-ai' => 'Logiciel & IA',
'weapons-tracking' => 'Armes & Tracking',
'scenarios' => 'Scénarios',
'instructor-cockpit' => 'Cockpit instructeur',
'after-action-review' => 'Debriefing (AAR)',
];
// 1) Hub FR
$fr_id = av_translate_page_fr($hub->ID, 'technology', $fr_titles['technology']);
if ($fr_id) {
echo "HUB EN #{$hub->ID} → FR #$fr_id (slug: technology)\n";
} else {
echo "HUB EN #{$hub->ID} : FR creation FAILED\n";
}
// 2) Detail pages FR
foreach (['vr-hardware', 'software-ai', 'weapons-tracking', 'scenarios', 'instructor-cockpit', 'after-action-review'] as $slug) {
$en = get_page_by_path("technology/$slug");
if (! $en) {
echo " $slug : EN page not found — skipping\n";
continue;
}
$fr_id = av_translate_page_fr($en->ID, $slug, $fr_titles[$slug]);
if ($fr_id) {
echo " $slug : EN #{$en->ID} → FR #$fr_id\n";
} else {
echo " $slug : FR creation FAILED\n";
}
}
echo "\nDONE. Now run /?av_generate_technology=1 again to push translated structure to FR via auto-sync.\n";
exit;
});