Initial public commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?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);
|
||||
Reference in New Issue
Block a user