Customizing login page

Permalink 12 users found helpful
I have tried every instruction found in the documentation & in the forum on how to customize single pages but none of them work. I would like to have the login page take the style from the template I am using but C5 only sees the core login style. I believe it is because the theme was installed & resides in the /packages folder & not the /themes folder. I even tried copying the login.php into my themes directory but no luck.

Can anyone guide me with an instruction that actually works when the templates are in the /packages directory?

Thanks

lchestnut
 
tallacman replied on at Permalink Reply
tallacman
I've done it here:http://www.myweddinglibrary.com/index.php/login/...

I'll make an instructional video and show you how and send you the link. It'll take a few minutes.

Steve
lchestnut replied on at Permalink Reply
lchestnut
Your site is beautiful! I appreciate your help. I am creating a intranet site for members only. Your login page is exactly what I am shooting for.

Thank you

Lisa
ThemeGuru replied on at Permalink Reply
ThemeGuru
Hey.

If your wanting to do this make sure the theme has a view.php file as well in the view.php

<?php
print $innerContent;
?>


No if your wanting to display errors i.e. when a user enters in wrong login credentials add:

<?php  if (isset($error) && $error != '') { ?>
   <?php  
   if ($error instanceof Exception) {
      $_error[] = $error->getMessage();
   } else if ($error instanceof ValidationErrorHelper) { 
      $_error = $error->getList();
   } else if (is_array($error)) {
      $_error = $error;
   } else if (is_string($error)) {
      $_error[] = $error;
   }
      ?>
      <ul class="ccm-error">
      <?php  foreach($_error as $e) { ?><li><?php echo $e?></li><?php  } ?>
      </ul>


No edit your site_theme_paths.php file. This is located in the /config folder.

Remove the code and replace it with this:

<?php  
defined('C5_EXECUTE') or die(_("Access Denied."));
$v = View::getInstance();
$v->setThemeByPath('/login', "c5bundle"); 
$v->setThemeByPath('/403', "c5bundle");
$v->setThemeByPath('/register', "c5bundle");
$v->setThemeByPath('/download_file', "c5bundle");
$v->setThemeByPath('/install', "c5bundle");
$v->setThemeByPath('/maintenance_mode', "c5bundle");
$v->setThemeByPath('/members', "c5bundle");
$v->setThemeByPath('/page_forbidden', "c5bundle");
$v->setThemeByPath('/upgrade', "c5bundle");
$v->setThemeByPath('/maintenance_mode', "c5bundle");
$v->setThemeByPath('/page_not_found', "c5bundle");
$v->setThemeByPath('/user_error', "c5bundle");


Replace the "c5bundle" with your custom theme name used on the actual folder. (found in the package under themes).

Hope that helps.

-Thomas

--
c5bundle - Launches Jan. 1/2011
http://c5bundle.net
lchestnut replied on at Permalink Reply
lchestnut
Excellent! Finally!

Thank you so much.

Now all I need to do is add additional css to style further?
ThemeGuru replied on at Permalink Reply
ThemeGuru
If you wouldn't mind it would be great to be marked as the answer. That way newcomers know what worked.
shadowcomputers replied on at Permalink Reply
shadowcomputers
This worked perfectly. Thank you.
wormracer08 replied on at Permalink Reply
wormracer08
Thanks ThemeGuru, just what I was looking for.
amorphous replied on at Permalink Reply
Perfect - Thanks so much - This worked perfectly with the destyle theme I'm using!
nando replied on at Permalink Reply
nando
Great I've bee looking exactly for this info, thanks!
diorist replied on at Permalink Reply
diorist
Worked splendidly. Thanks, ThemeGuru!
trobertson replied on at Permalink Reply
Hey Steve,

Do you think you can send me that instructional video also? I would appreciate it so much.

Thanks!,
T.J.
tallacman replied on at Permalink Reply
tallacman
sheesh!

http://performancec5.com/how-to/styling-the-login-page/...

It nice to have admiring fans.
frz replied on at Permalink Reply
frz
thanks!
kjphilips replied on at Permalink Reply
Hey if it makes you feel any better it was your video that got me there :). His tip about the error area was nice though. Now if I can just get a members page to appear!

Thank you!
PatrickHenry replied on at Permalink Reply
PatrickHenry
Thanks for the tut tallacman!
However, when I do this, it keeps looking in the concrete/themes folder for my theme.
It spits out the error:
Warning: include(/path/to/site/concrete/themes/ehc2012/elements/header.php): failed to open stream: No such file or directory in /Users/macbookpro1-2012/Desktop/webServer/c5/concrete5.6.0.2/concrete/core/libraries/view.php on line 419


How can I get it to look at my themes folder rather than the core themes folder?
Thanks in advance!
ShardCode replied on at Permalink Reply
ShardCode
Link no-longer works :(
melange replied on at Permalink Best Answer Reply
melange
Hi

DO you still have the instruction video?

Link is dead
CMSDeveloper replied on at Permalink Reply
CMSDeveloper
PatrickHenry replied on at Permalink Reply
PatrickHenry
And this is why the concrete5 forums are awesome. Because people help one another. Honestly, I wish all forums worked this well. I love the c5 community.
mlocati replied on at Permalink Reply
mlocati
> Try this:
>http://vimeo.com/tallacman
> Scroll down,

Yes, it's better to scroll down and get past the first videos ;)
LucaBn replied on at Permalink Reply
LucaBn
I found the first videos very interesting too, I suggest to anyone to have a look.
LickmeAnderson replied on at Permalink Reply
LickmeAnderson
@tallacman -

wtf? why do you say you know how and then not share it?
LucasAnderson replied on at Permalink Reply
LucasAnderson
You're seriously commenting on a post by tallacman that is over half a year old. Also, if you'd read further down from his post, it was answered by ThemeGuru. Calm yourself.
LickmeAnderson replied on at Permalink Reply
LickmeAnderson
wtf is your problem? I don't give a rat's ass what you think.
LucasAnderson replied on at Permalink Reply
LucasAnderson
You're dangerously close to getting the Troll badge.
frz replied on at Permalink Reply
frz
ass

just checkin.
frz replied on at Permalink Reply
frz
It looks like we modified our search word filter to allow ass.

wtf.

;)
Mnkras replied on at Permalink Reply
Mnkras
haha nice
LickmeAnderson replied on at Permalink Reply
LickmeAnderson
lol, you're seriously threatening me with a badge? sit yo ass down.
frz replied on at Permalink Reply
frz
mm. maybe we should modify it back. I found it easier to not accidentally misinterpret people as needlessly negative when they didn't show up swearing... and I'm a heathen! I can't imagine what the moms must be thinking!! ;)

regardless, thanks for following up with the details p1000. Hopefully someone else finds it helpful one day.
LickmeAnderson replied on at Permalink Reply
LickmeAnderson
Hey I'm not usually an ass (maybe.)

I just f'in hate it when people say they have the answer but don't share it. For some reason JackassAnderson wanted to start something, so I happily obliged.
frz replied on at Permalink Reply
frz
Okay that's enuf kids.

Lucas is a long time member and moderator here. His response "calm down" seemed pretty..well.. calm to me.

I imagine you might not enter a room full of people you never met and say "What The F*ck, where is the answer I want?"... ya know... tone counts - even online.. I'm confident Lucas doesn't want to start anything with you, he simply wants to move the project forward in a generally friendly fashion.

That being said, I totally get how frustrating it can be when you are close to finding an answer and it's just not quite there. I really respect the fact that you took the time to go ahead and post it back to this thread once you did find it. Nice work - clearly you know what you're doing and I hope you become an active member of the community. We could really use every smart cookie we can get.

Now lets go back to using our own names and avatars and move on to some actual challenges. ;)

-frz
zoinks replied on at Permalink Reply
EDIT: whoops, this post was directed at "LickmeAnderson," not Lucas Anderson (whom I respect and have received help from several times).

While the name-change and avatar struck me as comedy gold, this is by far the worst behavior I've ever seen on the Concrete5 forums, including my own frustrated posts (and that's saying a lot!)

"Lickme," I hope you will stick around and not be an ass anymore because I appreciate your willingness to help! (And your post did seem to incite tallacman to post his tutorial a year later, so that's good!)

BTW, Tallacman, I just bookmarked your website. Consider me an admiring fan! :)
kjphilips replied on at Permalink Reply
What does my ring say? ELE! what does ELE stand for? Yes Everybody Love Everybody!!

NOW EVERYBODY LOVE EVERYBODY!
taylormaai replied on at Permalink Reply
taylormaai
So here's what I've done to customize the login page.

The majority of the site uses a /themes/my-template001. It has a view.php, but for me it keeps single-pages, page_forbidden, and registration in the consistent theme.

I really wanted the login to have a completely different look and feel (no header and footer, no menu, not a popup, or dialog, etc...). So I created a new theme called /themes/my-template002. I then updated its view.php and style.css look how I wanted the login to display. Don't forget to "install" it in the dashboard. (don't activate it)

Then I went to the /config/site_theme_paths.php and updated the /login to point to my new my-template002 theme:
$v->setThemeByPath('/login', "my-template002");
$v->setThemeByPath('/page_forbidden', "my-template001");
$v->setThemeByPath('/register', "my-template001");


It appears after setting those config values listed above, it doesn't really matter in the dashboard's sitemap what "design/theme" you select for the /login. It will use the one set in that config/site_theme_paths.php.

Hope that helps provide an alternative approach. Good luck...

Mike
kehnee replied on at Permalink Reply
I think I might try your method. It just seems more flexible to customize. Thanks.
LickmeAnderson replied on at Permalink Reply
LickmeAnderson
I'll tell you exactly how to do it.

If you just want to change the "look" of page:

1. Open up /concrete5/themes/yourtheme
2. Open up view.php
3. Make sure you have
<?php
  print $innerContent;
?>

4. Open up /concrete5/config/site_theme_paths.php
5. Copy and paste this code:
<?php  
defined('C5_EXECUTE') or die(_("Access Denied."));
$v = View::getInstance();
$v->setThemeByPath('/login', "yourtheme");



If you want to change everything:

1. Open up /concrete5/concrete/single_pages/login.php
2. Select all and copy.
3. Open up /concrete5/themes/yourtheme
4. Create a new .php file and name it "login.php"
5. Paste code from step 1, save.
6. Open up /concrete5/config/site_theme_paths.php
7. Copy and paste this code:
<?php  
defined('C5_EXECUTE') or die(_("Access Denied."));
$v = View::getInstance();
$v->setThemeByPath('/login', "yourtheme");

8. Open up /concrete5/themes/yourtheme/login.php and change code, add CSS to your custom theme.
bastien31 replied on at Permalink Reply
Hi,

I success to customize login page but i want more ! :)

First, i add jquery ui to my login.php page, by adding a login.php in the root/controllers directory. This "login.php" is a copy of the "login.php" from the root/concrete/controllers directory.

I just change the view function, adding jquery ui.

Now, I want to put the register page in the login page. So how does it work. Cause it's the same. For the theming, i understand how to copy the content of the register page (register.php) in my login.php page theme.

But, what about the controllers ? cause it's in a register.php page. Can I unclude it in the login.php controllers ?

What is the good way to do it ?

thanks by advance
bastien31 replied on at Permalink Reply
I just reply to myself.

I put the template php fil register.php in my login file and i put the content of the register.php controller file in my login controller. It works.

The problem is that I wanted to have all in the same page, using an accordion. As the page is reloaded (i put the jquery loading in the view and the __construct functions, cos the view function was not called a second time), all the parameters are reinitialized, the accordion too.

So, to have a perfect behaviour, it seems I have to recode all the login and register with ajax... lot of work it seems.

Anybody worked on it ?
jordanlev replied on at Permalink Reply
jordanlev
I have done it, and it is a lot of work. I used ajax, but I think it will degrade gracefully if Javascript is disabled (although it will bring users to the normal C5 login or register page when they submit the form, not keep them on this custom page). Here is the code (note that this is completely unstyled -- you will have to apply your own styles via CSS):
<?php
global $u;
$is_logged_in = empty($u) ? false : $u->isLoggedIn();
if (!$is_logged_in) {
   echo Loader::helper('html')->javascript('jquery.form.js'); //Only include this if user isn't logged in because C5 includes it already for logged-in users.
}
?>
<script type="text/javascript">
$(document).ready(function() {
   $('#login-form').ajaxForm({
      'dataType': 'json',
      'beforeSubmit': function() {
         $('#login-error').hide();
         $('#login-form .submit').val('Logging In...');
      },


Enjoy!
bastien31 replied on at Permalink Reply
wow! :) Thanks a lot for your reply. I will try it and come back to tell you.
jordanlev replied on at Permalink Reply
jordanlev
Hope it works out. Note that I just went back and edited the code a little because I realized the thing I said to put in your theme <head> actually makes more sense combined with the rest of the code, so it's above all that other stuff now (this way it won't load on every page -- just on the combined login/reg page).
bastien31 replied on at Permalink Reply
it works perfectly ! just cut/paste and that's it.

I didn't test if the register form follow the features of confirmation or not by email that you put in the dashboard. I will see. Anyway, i will have to modify it for my needs.

My principal goal for this afternoon is to understand your code ! In a few lines, it does a lot. I don't understand for the moment how you plug with concrete5 core, with the DB, ... I will ;)

thanks !
jordanlev replied on at Permalink Reply
jordanlev
Cool. Let me know if you have any questions about how it works.
jcrooke replied on at Permalink Reply
jcrooke
Thanks for this, great help!
screame1 replied on at Permalink Reply
In the second option, on step #3, there is a mistake (at least as far as I could tell). "login.php" needs to go in single_pages. So the step should say:

3. Open up /concrete5/single_pages/

and then create "login.php" inside that folder. After doing that it worked for me! :)

Thanks for the help though, because you got me going in the right direction!
miguelgilmartinez replied on at Permalink Reply
miguelgilmartinez
LickmeAnderson is so great!!!!! Thank you very much!!!
gwp1971 replied on at Permalink Reply
seems concrete5 has been updated since this post.
I am using V5.4.2.1
if you look at config/site_theme_paths.php
you will see they have made it easier
/* 
   you can override system layouts here  - but we're not going to by default 
   For example: if you would like to theme your login page with the Green Salad theme,
   you would uncomment the lines below and change the second argument of setThemeByPath 
   to be the handle of the the Green Salad theme "greensalad" 
*/
$v = View::getInstance();
$v->setThemeByPath('/login', "gravity_well");
$v->setThemeByPath('/page_forbidden', "yourtheme");
$v->setThemeByPath('/register', "yourtheme");

you just change the "yourtheme" to the name of the theme folder in
concrete5/packages/theme_gravity_well/themes/gravity_well
and your theme displays just fine.

Edit: it displays fine, but i have yet to find out how to add header images etc.
jordanlev replied on at Permalink Reply
jordanlev
This is not new -- it's been like this for as long as I can remember (5.3 at least)?

As for "adding header images", I'm not sure what you mean, but basically if you modify the site_theme_paths.php file to put in your own theme handle, then it will use your theme's view.php file to render that page. So put header images, editable areas, whatever you want in that view.php file and you're good to go.
gwp1971 replied on at Permalink Reply
thnaks for the tip about modifying the view.php.
before i do this, does the view.php page affect any other page, such as the theme pages i have with my current theme (righsidebar, leftsidebar etc)
I dont want the lgo etc to appear twice
Also, can i just link to the header/footer pages of my theme?
jordanlev replied on at Permalink Reply
jordanlev
view.php is the template for "single_pages", which are basically system pages (such as login and register) and other special pages installed by some packages/addons -- so no, it shouldn't affect your other theme templates (right_sidebar, left_sidebar, etc.).
See the "View.php" section of this page for more details:
http://www.concrete5.org/documentation/developers/pages/themes...
jalewagger replied on at Permalink Reply
Thank you themeguru . It worked perfectly as i want.. can you please update more information. <a href="http://gamespiders.weebly.com/">click... here</a> .
MagsAtWcg replied on at Permalink Reply
MagsAtWcg
Hi all.
First post from a newby... Greetings!!

Been following the thread, little disappointed with the bickering, but that apart there are people here who know exactly what they're talking about. Respect to all of you. Been trying to change the look of my Login and Register pages, and although all the advice here is great, it doesn't help a learner! I sort of understand the basics, and believe me if I could afford to have this done for me I would! So here is the question. I get what is said, but there are lots of view.php files, lots of login.php and register.php files. It would be greatly appreciated if someone could offer guidance as to which files in which folders need to be modified. Please be gentle with me!!

Thanks in advance if someone can share his/her knowledge
PatrickHenry replied on at Permalink Reply
PatrickHenry
Welcome MagsAtWcg,
Glad to have you aboard. No worries. You've came to the right place. The c5 community is a very forgiving and helpful place who's members seem to always remember that kindness and help go much further than heckling.
That being said, you need to have access to your c5 files, either locally or SFTP, whatever you use to directly access them.
If you have not updated c5 with this install, go to:
siteroot/concrete/single_pages/login.php


Copy that file to:
siteroot/single_pages/login.php


This creates your core over-ride that will allow your edits to stick, even after upgrading the c5 core. Very innovative approach and makes it all easy to maintain.

Edit away on that copied file and you'll see your edits occur on the login page.
Dido for the Register page. Exact same process b/c both login and register are single_pages in the system, so they're all stored in the same place.

IF you've upgraded c5, instead locate the files to duplicate at:
[code]siteroot/updates/concrete5.6.whatever_ur_on/concrete/single_pages/login.php

Hope this helps.
Welcome once again.
And look forward to seeing you around, and maybe returning the favor someday to another noobie :)

Cheers,
Pat.
micrdy replied on at Permalink Reply
micrdy
Would be nice if someone would outline the code for 5.7 ;)
micrdy replied on at Permalink Reply
micrdy
Would be nice if someone would outline the code for 5.7 ;)
MrKDilkington replied on at Permalink Reply
MrKDilkington
@micrdy

Here is some information on overriding the login and form.
https://www.concrete5.org/community/forums/customizing_c5/i-have-tur...

"Applying Your Theme to Single Pages with "Theme Paths""
https://www.concrete5.org/documentation/developers/5.7/designing-for...
micrdy replied on at Permalink Reply
micrdy
Thanks for your answer. But the code mentioned above to display error messages on login failure doesn´t work for 5.7
Korvin replied on at Permalink Reply
Korvin
It looks to work for me, can you show what you changed?