- Blueprints : renommage des champs (member_name, related_articles, background_video, play_links, images_gallery, external_links) et des noms de sections - Templates JSON PHP : clés de sortie et appels ->method() en camelCase - Vues Svelte (Play, Portfolio) : accès aux données alignés Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
24 lines
766 B
PHP
24 lines
766 B
PHP
<?php
|
|
|
|
$specificData = [
|
|
'hero' => [
|
|
'title' => $page->heroTitle()->value(),
|
|
'titleHighlight' => $page->heroTitleHighlight()->value(),
|
|
'subtitle' => $page->heroSubtitle()->value(),
|
|
'ctaText' => $page->ctaText()->value(),
|
|
'ctaPath' => $page->ctaLink()->toPage()?->id() ?? '#',
|
|
'image' => $page->heroImage()->toFile()?->url()
|
|
],
|
|
'backgroundVideo' => $page->backgroundVideo()->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);
|