world-game/site/templates/home.json.php
isUnknown 50f81269ac Feat: Home récupère subtitle et CTA depuis les données Kirby
- Renommage des champs blueprint : cta_text → ctaText, cta_link → ctaLink
- Template home.json.php : expose ctaText et ctaPath (id de page Kirby)
- Home.svelte : suppression des traductions en dur, lecture de data.hero

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-18 12:08:08 +01:00

24 lines
776 B
PHP

<?php
$specificData = [
'hero' => [
'title' => $page->hero_title()->value(),
'title_highlight' => $page->hero_title_highlight()->value(),
'subtitle' => $page->hero_subtitle()->value(),
'ctaText' => $page->ctaText()->value(),
'ctaPath' => $page->ctaLink()->toPage()?->id() ?? '#',
'image' => $page->hero_image()->toFile()?->url()
],
'background_video' => $page->background_video()->toFile()?->url(),
'floating_bubbles' => $page->floating_bubbles()->toStructure()->map(function($bubble) {
return [
'text' => $bubble->text()->value(),
'position' => $bubble->position()->value()
];
})->values()
];
$pageData = array_merge($genericData, $specificData);
header('Content-Type: application/json');
echo json_encode($pageData);