So how does this work? Step by step, here we go:
- Go to
YOURSITE/config/site_theme_paths.php
and uncomment the following code:
$v = View::getInstance();
$v->setThemeByPath('/login', 'my_theme_handle');
$v->setThemeByPath('/register', 'my_theme_handle');
$v->setThemeByPath('/page_not_found', 'my_theme_handle');
$v->setThemeByPath('/page_forbidden', 'my_theme_handle');
$v->setThemeByPath('/download_file', 'my_theme_handle');
$v->setThemeByPath('/maintenance_mode', 'my_theme_handle');
Where it says “my_theme_handle”, replace that text with the folder name of your theme as seen in (root)/themes.
- If you’re using a version of Concrete5 before v5.4.2, download the system_errors.php file and put it in your themes
/elements
folder (something like [root]/themes/your_theme/elements/system_errors.php
). Otherwise, go to step 3.
- Open the view.php file in your theme. Above print_innerContent, paste the following code:
<?php Loader::element('system_errors', array('error' => $error)); ?>
- Go to
yoursite.com/login
and test it out (enter a wrong password & you should see an error message). You can also visit the other pages (like yoursite.com/fake_page
) and see what the other error messages look like. Style them if necessary.
As a note, I have only been able to get this working on sites running Concrete 5.4.2+, but your results may vary.
Again, big props go out to JordanLev for this. If you like this technique, give a thumbs up or leave a comment below. Disqus will color code any HTML written in pre and code tags.
I’ve recently removed comments from this blog. Want to chime in? See something wrong?
Email me at Email me!. I’d love to hear from you. I read every email and welcome your input.