If there is an error in Magento, you will see the following page:
Or if we need to update the production and we turn on maintenance mode, we have the following page:
Not so attractive, right?
However, we can change the display of these pages by creating a new theme for errors. Let our theme be called magedirect.
In the pub/errors folder, we create a new local.xml file with the following content:
1 2 3 4 | <?xml version="1.0" ?> <config> <skin> magedirect </skin> </config> |
In the pub/errors folder, we create a new magedirect folder. For simplicity, just copy the contents of the pub/errors/default folder to our magedirect folder. It turns out the following structure:
For modifications to the maintenance page, we can simply edit the HTML file in the file 503.phtml. Styles can be written in the css/styles.css folder.
For example, we have made the following maintenance page:
In the same way, you can edit the report.phtml or 404.phtml file to change the look of the error page or 404 pages respectively.
Nothing difficult, right?
Ihor KlymchukTechnical Lead
- If you’re a newbie merchant and don’t know how to install Magento 2...
- Get frustrated when it comes to adding Magento multiple languages? Not a...
- Although it can take much time and efforts to migrate Magento 1 to Magento 2 it...
- If you don’t know how to create a custom cache type in Magento, this article...
- Find out about Magento Enterprise Cloud Edition in our article to get more from...
- Are you planning to turn your ordinary store into a great online mall but...
- This article is devoted to the best free Magento Themes. View the list of 7 the...
- In the Magento world, it becomes more and more popular to create Progressive...