In this tutorial you will learn how to create a 404 page for your site using the developer mode.
IMPORTANT: This is an advanced tutorial that includes code. We have created this tutorial to show you how easy it is to create 404 pages if you know how to write code. We can not teach you how to write code and we will not help with code related questions regarding this tutorial. This tutorial is only for advanced users. If you make a change in the code of your site that breaks the editor you will have to re-apply the template to fix it.
STEP 1. Access the Developer mode
STEP 2. Create a new file
1. Click on the + icon by the side of TEMPLATE FILES
2. Select New file
STEP 3. Create the 404 page
Type 404.twig onto the field and save your changes
STEP 4. Copy and paste default code
The newly created 404.twig will be empty, so you need to go to the default.twig, copy every single line of code in there and paste it inside your 404.twig. Save your changes.
STEP 5. Create the new page type
1. Go to the file called metadata.json
2. Search for the pageTypes array on the code, add the 404 page and save
Adding the 404 page type:
STEP 6. Go back to the editor
Go back to your editor and create a new page with the tools offered
1. Name your page
2. Make sure you select the 404 page type
3. Click on Done
You can add any widgets you want onto your 404 page. After you publish users will be taken there if they try to access a non-existent page.