×

You're using an outdated browser

For a better experience, keep your browser up to date. Check here for the latest version.

Manual

Add error templates

Thomas Walker

Thomas Walker Last update: Oct 27, 2017

If an error occurs while rendering the page, Scroll Viewport locates the appropriate error template to render that error.

Creating Velocity templates for error pages

Create a new Velocity template called error.vm, then fill it with the following content and upload it:

Creating a default error-page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>$statusCode - $statusText</title>
	</head>
	<body>
		<h1>$statusCode - $statusText</h1>
		<p>An error occurred</p>
	</body>
</html>

Redirect to another page

To redirect from an error page to another page, implement the following code into your error page:

Redirecting from an error 404 page to the homepage

#if ($statusCode == 404)
    <script>window.location = "$space.link";</script>
#end

In this example, the user would be redirected to the homepage of the space if an 404 error occurs.

2x2.12
We use cookies to create a secure and effective browsing experience for our website visitors and to understand how you use our site (i.e. Google Analytics). For more information: click here.
Ok