Styling register / login.php copy
Permalink 1 user found helpful
Howdy
First off, i hope this all makes sense as i'm not brilliant at trying to explain things! I've looked high and low for a solution to this but can't work it out...
Having read through a couple of posts etc on single page theming it looks like you should be able to just copy the login.php or register.php from concrete/single_pages/, stick it in root level /single_pages folder and then create a file in your theme folder with the same name to use that layout automatically. However this doesnt seem to work.
I've copied the login.php file and renamed it sign_in.php, saved it in /single_pages/ and then created a file in my theme folder called sign_in.php with the layout etc i want and it all works fine. However for some reason if i use login or register it doesnt.
Anyone had this problem before or any ideas why this might be happening? Seems strage how it works if i change the name but not if i keep the current one!
Many thanks for any help!!
First off, i hope this all makes sense as i'm not brilliant at trying to explain things! I've looked high and low for a solution to this but can't work it out...
Having read through a couple of posts etc on single page theming it looks like you should be able to just copy the login.php or register.php from concrete/single_pages/, stick it in root level /single_pages folder and then create a file in your theme folder with the same name to use that layout automatically. However this doesnt seem to work.
I've copied the login.php file and renamed it sign_in.php, saved it in /single_pages/ and then created a file in my theme folder called sign_in.php with the layout etc i want and it all works fine. However for some reason if i use login or register it doesnt.
Anyone had this problem before or any ideas why this might be happening? Seems strage how it works if i change the name but not if i keep the current one!
Many thanks for any help!!
Cheers, but thats not quite what i'm looking for.
I did use that to set some of my other ages to use my view.php but i'm looking to have a different template for just the login and register pages.
In the article about styling single pages here -http://www.concrete5.org/documentation/developers/pages/single-page...
In the 'Customizing A Single Page's Appearance' section it reads like you can just save a new version of the login.php to your single_pages directory (for example), create a new template page with the same name and add it to the current theme directory and it will use it automatically. This doesnt appear to work for either login or register however.
i'm completely baffled by it as it seems to work if i copy the login.php file and rename it!
I did use that to set some of my other ages to use my view.php but i'm looking to have a different template for just the login and register pages.
In the article about styling single pages here -http://www.concrete5.org/documentation/developers/pages/single-page...
In the 'Customizing A Single Page's Appearance' section it reads like you can just save a new version of the login.php to your single_pages directory (for example), create a new template page with the same name and add it to the current theme directory and it will use it automatically. This doesnt appear to work for either login or register however.
i'm completely baffled by it as it seems to work if i copy the login.php file and rename it!
It's the naming of the file that you are having trouble with. Because of the MVC nature of concrete5 there is another file
That handles part of the work. If you rename your /single_pages/login.php file to something else then these two files won't line up. You can technically copy the login.php file in controllers to something else like
and then
And then add this as a single page in the dashboard. But as you are probably gathering, this is fairly lengthy and not very upgrade proof.
A better solution may be to just override /single_pages/login.php and then create an Alias page somewhere else with a different name using the sitemap in the dashboard. Then you can still link to /sign_up but it will continue to use the login.php file.
/concrete/controllers/login.php
That handles part of the work. If you rename your /single_pages/login.php file to something else then these two files won't line up. You can technically copy the login.php file in controllers to something else like
/controllers/sign_up.php
and then
/single_pages/sign_up.php
And then add this as a single page in the dashboard. But as you are probably gathering, this is fairly lengthy and not very upgrade proof.
A better solution may be to just override /single_pages/login.php and then create an Alias page somewhere else with a different name using the sitemap in the dashboard. Then you can still link to /sign_up but it will continue to use the login.php file.
ah i didnt think about the controllers, that's useful to know.
However the real problem i'm having is in overriding the login.php single page and getting it to use the login.php template i've added to my theme directory.
I've basically added a template (which is almost a copy of view.php with a few changes) to my theme folder called login.php and i was under the assumption from reading about single pages that single_pages/login.php would use this as the template. However it doesnt seem to work. Do you know if this is the case?
I just copied the login and called it sign_up.php to test it out really as with a different name.
Thanks though!
However the real problem i'm having is in overriding the login.php single page and getting it to use the login.php template i've added to my theme directory.
I've basically added a template (which is almost a copy of view.php with a few changes) to my theme folder called login.php and i was under the assumption from reading about single pages that single_pages/login.php would use this as the template. However it doesnt seem to work. Do you know if this is the case?
I just copied the login and called it sign_up.php to test it out really as with a different name.
Thanks though!
Oh. I think I understand now. AFAIK you can't override singe pages inside of a theme. You have to do it in the site root /single_pages directory. I don't think you can do
You can only do
That said, you may be able to do it in the packages directory
Although, I've never tried that and have no idea if it would work.
/themes/my_theme/single_pages/login.php
You can only do
/single_pages/login.php
That said, you may be able to do it in the packages directory
/packages/my_theme_package/single_pages/login.php
Although, I've never tried that and have no idea if it would work.
I know this is an old post, but someone might still find it.
You can override a single page in your theme.
You'll still need site_theme_paths.php to look like this:
But if you then create a file called login.php in /themes/test_theme/ you can use whatever code you look to style the login page. You might want to start by copying view.php and replace echo $innerContent with the content of /concrete/single_pages/login.php
But keep in mind that you're going to copy several lines of code. If you're upgrading to a newer version of concrete5 in the future, you might run into some issues!
You can override a single page in your theme.
You'll still need site_theme_paths.php to look like this:
<?php $v = View::getInstance(); $v->setThemeByPath('/login', 'test_theme');
But if you then create a file called login.php in /themes/test_theme/ you can use whatever code you look to style the login page. You might want to start by copying view.php and replace echo $innerContent with the content of /concrete/single_pages/login.php
But keep in mind that you're going to copy several lines of code. If you're upgrading to a newer version of concrete5 in the future, you might run into some issues!
Just to close this one off the reason i couldnt get the my_theme/login.php to work was because i'd removed login from pointing to my theme in the site_theme_paths. Schoolboy error!
However, while i'm here, where abouts is the layout of the login and register forms? It doesnt appear to be in the single page itself. When i copy them over to my root /single_pages folder i dont have the fieldsets etc and the layout is slightly different.
I'd quite like to keep the default layout but with some minor changes of my own...
Ta!
However, while i'm here, where abouts is the layout of the login and register forms? It doesnt appear to be in the single page itself. When i copy them over to my root /single_pages folder i dont have the fieldsets etc and the layout is slightly different.
I'd quite like to keep the default layout but with some minor changes of my own...
Ta!
TITLE: 'Theming System Single Pages like Login, Register, etc'
SOURCE: http://www.concrete5.org/documentation/how-tos/designers/themimg-sy...
It may be of some help.