Spruce up your Concrete5 login page

posted by adam johnson on August 23, 2011

Concrete5 user JordanLev wrote a reply to a post a while back that detailed his method for customizing the Concrete5 system pages (for example: login, page not found, register, etc) that is infinitely easier to manage and maintain than other traditional methods.

So how does this work? Step by step, here we go:

1. 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.

2. 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.

3. Open the view.php file in your theme. Above print_innerContent, paste the following code:

<?php Loader::element('system_errors', array('error' => $error)); ?>

5. 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.

Update 8/21/13: There are two how-to's on on Concrete5.org that explain this technique as well.

blog comments powered by Disqus