world-game/site/templates/expertise.json.php
isUnknown 1625ee1c44
All checks were successful
Deploy / Deploy to Production (push) Successful in 26s
expertise : fix title custom marks implementation
2026-03-20 09:53:49 +01:00

15 lines
547 B
PHP

<?php
$specificData = [
'pageTitle' => $page->writer()->inline()->value(),
'backgroundVideo' => $page->backgroundVideo()->toFile()?->url(),
'backgroundVideoReverse' => $page->backgroundVideoReverse()->toFile()?->url(),
'items' => $page->body()->toBlocks()->filter(fn($b) => $b->type() === 'text')->map(fn($block) => [
'text' => $block->text()->value()
])->values()
];
$pageData = array_merge($genericData, $specificData);
header('Content-Type: application/json');
echo json_encode($pageData);