25 lines
791 B
PHP
25 lines
791 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
$specificData = [
|
||
|
|
'hero' => [
|
||
|
|
'title' => $page->hero_title()->value(),
|
||
|
|
'title_highlight' => $page->hero_title_highlight()->value(),
|
||
|
|
'subtitle' => $page->hero_subtitle()->value(),
|
||
|
|
'cta_text' => $page->hero_cta_text()->value(),
|
||
|
|
'cta_link' => $page->hero_cta_link()->toPage()?->url() ?? '#',
|
||
|
|
'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);
|