Error page
Error page
The Error page template is rendered when a there is an error or when the requested page doesn't exist.
Available properties
You can use the following properties in the Error page template.
Name | Type | Description |
---|---|---|
error | string | The error type |
status_code | integer | The error status code |
promoted_articles | array | An array of promotedarticle对象 |
ticket_forms | array | An array ofticket form对象 |
help_center | object | Ahelp_centerobject that holds information and settings about the current help center |
settings | object | Asettingsobject with custom settings for the current theme |
Possible errors and status codes:
Error | Status Code | Description |
---|---|---|
"unauthorized" | 401 | User has to be authenticated to proceed |
"forbidden" | 403 | User is not allowed to proceed |
"not_found" | others | Page doesn't exist or there was another problem |
Available helpers
You can use anybuilt-in helpers,global helpers, orglobal advanced helpersin this page template.
Example
<divclass="error-page">
<h1>{{t 'oops'}}h1>
{{#is error 'unauthorized'}}
<h2>{{link 'sign_in'}}h2>
{{/is}}
{{#是错误的禁止}}
<h2>{{t 'not_authorized'}}h2>
{{/is}}
{{#is error 'not_found'}}
<h2>{{t 'nonexistent_page'}}h2>
<p>{{t 'mistyped_address_or_moved_page'}}p>
{{/is}}
{{#link 'help_center'}}
{{t 'back_to_homepage'}}
{{/link}}
div>