You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
525 B
PHTML
18 lines
525 B
PHTML
8 years ago
|
<?php
|
||
|
|
||
|
// Determine snippet name and fall back to default if it does not exist
|
||
|
$snippet = 'templates/' . $page->intendedTemplate();
|
||
|
if(!$kirby->get('snippet', $snippet)) $snippet = 'templates/default';
|
||
|
|
||
|
// Define structured data for the frontend AJAX code
|
||
|
$data = [
|
||
|
'url' => $page->url(),
|
||
|
'cachable' => $page->isCachable(),
|
||
|
'title' => $page->title() . ' ~ ' . site()->title(),
|
||
|
'nav' => snippet('nav', [], true),
|
||
|
'main' => snippet($snippet, [], true)
|
||
|
];
|
||
|
|
||
|
// Return it as JSON
|
||
|
echo response::json($data);
|