By wOOge on
I'm looking for the equivalent of: page-user-login.tpl.php in Drupal 7 ( D7 ).
I'm looking to change or alter the layout of the user login page ( /user/login ), but more than just replacing values through hook_form_alter().
Any help is much appreciated!!
Comments
SOLUTION
Answered my own question:
In
template.phpplace the following code, but replace "YOURTHEME" with... you theme name:Then create a file called
user-login.tpl.phpand place it in your theme folder's root.--
wOOge | adrianjean.ca
Doesn't work to me.
And what I should to put into the user-login.tpl.php file?
What about the whole page?
This only themes the form. Do you know how to do the whole page?
Just
Just
page--user--login.tpl.phpI just wrote an entire blog
I just wrote an entire blog post on this last week: http://dannyenglander.com/blog/customizing-user-login-page-drupal-7
It should give you everything you need.
Danny Englander | Twitter | Instagram
Once I've created a new
Once I've created a new template, how do I link it to the certain content types?
Creating Custom template file for custom content type.
Create a custom content type. Say "Membership Page" . Add fields to it. For creating its tpl file. You need to create a file with name as node--membership-page.tpl.php .Prefix "node--" is a must for creating tpl file for a custom content type. It will get automatically linked to ypu content type. Place this .tpl.php file in sites/all/themes .
Nice Blog Post
The solution in the blog worked well enough for my needs, but how do I edit the registration area?
I got this to work
Adding to the template.php of the theme, and creating a file called 'user-register-form.tpl.php'
does user-register-form.tpl.php start from a existing template?
xbrianx, does user-register-form.tpl.php start from a existing template in the system? or can it be a blank?
Add template.php website
Great code that has been active on my website, some of the customizations on the web that work well thankyou
Link is broken
Your link is broken has it moved somewhere else?
Was also looking for this.
Was also looking for this. Found it here: http://dannyenglander.com/blog/customizing-user-login-page-drupal-7
Whatever I try on my drupal 7
Whatever I try on my drupal 7 .. i cannot get the above to work. I am using Marinelli as my theme, but I also tried the above with Bartik and others that come with drupal.
Below is what i have in my template.php
I have the folling file in my themes/marinelli/templates/ folder
page--user-login.tpl.php
I aso tried with
user-lgin.tpl.php
but it still loads my page.tpl.php page. As a workaround I have in my page.tpl.php
Not the solution I am looking for :(
See
See http://drupal.org/node/1089656 - "How Drupal determines page theme hook suggestions based on path".
Just use
page--user--login.tpl.phpif you accessing path like yourdomain.com/user/login, if you want yourdomain.com/user, usepage--user.tpl.phpwithout any additional code in template.php file.Drupal hook suggestions based on path
Brutal! :D
Thanks.
Customise Drupal login PAGE
I see so much trouble for simple things. I just scrolled for a bunch of posts how to theme the "Login Page" but actually people are theming the login block, imitating each other posts all over their blogs and websites.
Do you want to achieve a minimal designed and beautiful page like this?
Login page:
http://s10.postimg.org/42qaumbbt/login.pngPassword page:
http://s22.postimg.org/lv2psotsh/password.png1 )
Create the login and password empty page files and place them in your theme "templates" folder.
The name of the files are
page--user--login.tpl.phpandpage--user--password.tpl.php. There's no need of all those steps of "hook", "alter", blablabla... Drupal will use those files automatically without any call or whatever.2 )
Put this code inside your files.
page--user--login.tpl.php
page--user--password.tpl.php
3 )
Done!
In thee steps. Now style your
cssas much you need and pimp your new fancy login page. "Inspect" yourhtmloutput of your new login page and see how clean it is now. ; DAfterwords )
I just spent this last hour reading posts and questions about this all over the internet, and the work around in some cases are simply crazy like using the
dpm(get_defined_vars());function, copying html and paste all of those input forms and attributes, blablabla.I didn't found a concise post like this. It's crazy!!!
Also, you will need (if you still don't have it and if you want it) to disable "label/description" and enable "placehover" for the inputs. You can do it all together like this:
PS )
Do you have the "header", "footer" and "sidebar" visible and want to remove them too? No problem.
Go to
#overlay=admin/structure/blockand click "configure". Scroll down and include this on "Show block on specific pages" option:Done!
Drupal it's incredible powerful. I think people complicate things a lot and if you see it in a simple way it will be more efficient... Most of the things you can do it inside Drupal environment.
Works but with Warning
Dropal's idea works but a warning msg is displayed at the top of the page.
Error messageStrict warning: Only variables should be passed by reference in include() (line 3 of ....templates/page--user--login.tpl.php).
Anyone has any idea what its telling?
TD
That's because drupal_get
That's because
drupal_get_formis nested insidedrupal_render.Hence replace:
With:
Changing the submit button
Thanks, Dropol. This post started me on the right track. If anyone wants to change the text of the submit button, add the following line.
$form['actions']['submit']['#value'] = t('add desired text for submit button here');
does this still work for 7.43 on front login user page
Hello everyone, I am using 7.43 with a custom bootstrap theme. I have tried this answer from dropal with no success. I’m getting a blank page when I implement this answer. I am using drupal 7.43 at the moment. I used the page--user--login.tpl.php example and the exact code 3 lines of code shown above. I also add the template page code. Can someone please assist me with this issue. I have been working on it for too long!
My goal was to have the template control over the front login page and the logged in page as well.
thanks in advance!
This template file helped
The template file at http://dannyenglander.com/blog/customizing-user-login-page-drupal-7 saved the day for me. It helped me find the variables that I needed to change.
error
Made everything you said.
This is my code:
if (!$user->uid) :print $messages;print drupal_render(drupal_get_form('user_login'));"Request new password"
endif;This is the error:
Strict warning: Only variables should be passed by reference in include() (line 88 in file /sites/all/themes/venture_theme/templates/page.tpl.php).
How can I solve it?
That's not actually an error,
That's not actually an error, it's a warning.
Anyways, you can fix it as follows:
Contact me to contract me for D7 -> D10/11 migrations.
Made you said but it doesn't work
but it circles the redirection while I'm logged.... I tried to print it in new block and then place at the region but..... so it doesn't work.... how can I solve it?
I also stuck somehow. I user
I also stuck somehow. I user custom popup to show user/login form and user/register form now i have 2 issues. one validation message how to print in popup.
And is big issue when i user rules or trigger for user redirection on home page after login or register user nothing work on it. i am using drupal 7.3 version.
even no nay module fork for me on this situation.