Custom Theme Specific Single Pages - Login, Register, 404

Custom Theme Specific Single Pages - Login, Register, 404

Perhaps one of the most overlooked aspects of concrete5 theme design is that you can in fact also style the login, register and even 404 single pages, amongst others.


Article by Andy / / Comments / Difficulty 
Custom Theme Specific Single Pages - Login, Register, 404

Concrete5’s native ability to allow you to safely overwrite core files whilst retaining the apps integrity; gives developers the opportunity and freedom to customize various aspects of the system without danger of breaking anything should they wish to upgrade.

Overwriting files from the core is easy. If you know how.

Perhaps one of the most overlooked aspects of concrete5 theme design is that you can in fact also style the login, register and even 404 single pages, amongst others. This can be done directly in your theme folder; here is how to do it.

  1. Make a copy of the login.php file which you will find here concrete > single_pages > login.php
  2. Copy this file directly into your theme folder
  3. Next you will need to open up the site_theme_paths.php file which can be found from the root of your concrete5 install in the config folder
  4. Simply uncomment the code $v = View::getInstance(); and $v->setThemeByPath('/login', "yourtheme"); replacing “yourtheme” with your actual theme name. For example if you theme was called my_awesome_theme then the code should be $v->setThemeByPath('/login', "my_awesome_theme");

Following the above will give you a login.php file in your theme that you can edit to match in with your theme.

The next step is to make sure you have all of your wrapping markup (header and footer items etc) - using either your view.php or a simple current page type as a template should give you a good idea of what you need to include.

Top Tip: If you simply follow step 4 and miss out the rest, then your login page will use your view.php from your theme to wrap the login form which should go part way to help matching this in to the rest of your design.

This technique is not limited to just the login page. You can in fact follow a similar process for other single page such as Register, Page Not Found & Page Forbidden. Simply add or uncomment these lines of code in your site_theme_paths.php file:

Register

$v->setThemeByPath('/register, "my_awesome_theme");

Page Forbidden

$v->setThemeByPath('/page_forbidden', "my_awesome_theme");

404 Page Not Found

$v->setThemeByPath('/page_not_found', "my_awesome_theme");

Don’t forget to make sure you are using your own theme name in place of "my_awesome_theme".

Join the conversation

comments powered by Disqus