world-game/site/templates/home.json.php
isUnknown 4d425dd126
All checks were successful
Deploy / Deploy to Production (push) Successful in 19s
fix home subtitle
2026-03-17 10:34:29 +01:00

25 lines
939 B
PHP

<?php
$specificData = [
'hero' => [
'subtitle' => $page->subtitle()->inline()->value(),
'ctaText' => $page->ctaText()->value(),
'ctaPath' => $page->ctaLink()->toPage()?->id() ?? '#',
'image' => $page->heroImage()->toFile()?->url()
],
'backgroundVideo' => $page->backgroundVideo()->toFile()?->url(),
'backgroundVideoPoster' => $page->backgroundVideoPoster()->toFile()?->url(),
'backgroundVideoMobile' => $page->backgroundVideoMobile()->toFile()?->url(),
'backgroundVideoMobilePoster' => $page->backgroundVideoMobilePoster()->toFile()?->url(),
'floatingBubbles' => $page->floatingBubbles()->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);