404 pages rendreed within layout

Before this pull request, the 404 and 404-search templates where handled
as full HTML pages without the page context (layout).

With this pull request both pages are rendered inside the selected
themes layout. Additionally the 404 template now contains the "search
form" and the homepage link.

All Themes are already updated with the above changes.
This commit is contained in:
Andreas 2015-08-24 12:44:28 +02:00
commit 41ae84a129
17 changed files with 133 additions and 168 deletions

View file

@ -654,13 +654,7 @@ function get_keyword($keyword, $page, $perpage)
}
}
if (empty($tmp)) {
// a non-existing page
render('404-search', null, false);
die;
}
return $tmp = get_posts($tmp, $page, $perpage);
return ($tmp) ? get_posts($tmp, $page, $perpage) : [];
}
// Get related posts base on post tag.
@ -1543,7 +1537,13 @@ EOF;
function not_found()
{
header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");
render('404', null, false);
render('404', array(
'title' => 'This page doesn\'t exist! - ' . blog_title(),
'description' => '',
'canonical' => false,
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; 404 Not Found',
'bodyclass' => 'error-404',
));
die();
}