-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[6892] Add error pages (404, 500) to Wordify BP (#118)
* [6892] Add error pages (404, 500) to Wordify BP * [6892] Add go home button * [6892] Add error page check-in * [6892] Rename error template and macro from layout to errorPageLayout * [6892] Remove old error layout ftl file * Version update
- Loading branch information
Showing
4 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<#include "./errorPageLayout.ftl"> | ||
|
||
<@errorPageLayout | ||
pageTitle="Page not found" | ||
errorCode="404" | ||
errorMessage="Sorry, we couldn't find the page you're looking for" | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<#include "./errorPageLayout.ftl"> | ||
|
||
<@errorPageLayout | ||
pageTitle="Internal Server Error" | ||
errorCode="500" | ||
errorMessage="Oops! A server error has occurred and we were unable to fulfill the request.<br/> Please try again. If the error persists, contact the administrator of the site." | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<#macro errorPageLayout | ||
pageTitle="" | ||
errorCode="" | ||
errorTitle=pageTitle | ||
errorMessage="" | ||
> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>${pageTitle}</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<link href="https://fonts.googleapis.com/css?family=Josefin+Sans:300, 400,700|Inconsolata:400,700" rel="stylesheet"> | ||
<link rel="stylesheet" href="/static-assets/css/bootstrap.css"> | ||
<link rel="stylesheet" href="/static-assets/css/style.css"> | ||
<style> | ||
.wrap { | ||
height: 100vh; | ||
text-align: center; | ||
padding-top: 8rem; | ||
padding-bottom: 8rem; | ||
} | ||
.title { | ||
font-size: 60px; | ||
} | ||
@media (max-width: 992px) { | ||
.title { | ||
font-size: 40px; | ||
} | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="wrap"> | ||
<p>${errorCode}</p> | ||
<h1 class="title">${errorTitle}</h1> | ||
<p>${errorMessage}</p> | ||
<a href="/" class="btn btn-primary rounded">Go back home</a> | ||
</div> | ||
|
||
<script defer src="/studio/static-assets/scripts/craftercms-xb.umd.js"></script> | ||
<script> | ||
document.addEventListener('craftercms.xb:loaded', () => { | ||
window.craftercms.xb.post('ERROR_PAGE_CHECK_IN', { code: ${errorCode}, message: "${errorMessage}"}); | ||
}); | ||
</script> | ||
</body> | ||
</html> | ||
</#macro> |