1

Most of the tuts I found want me to edit the code in template but I am not sure about editing the code, so, thought of asking is there any easy way to create Login Form in Drupal 7.

I don't want to show login block to everyone, and want to put it in some Page and visit it via uri like http://localhost/login then only the login page should show.

So, far I have made a Page called login gave it a title with empty body, Configured user-login block to be shown in content area and be displayed only in login page. So far so good, it looks cool, but the thing is: after logging in I can see the same login page as Blank Page. I did something like the login page would only be accessible by anonymous users but no luck.

My quest is either I should be able to redirect the users to main page after logging in, or have a separate login page instead of using the block which came by default with D7 installation. Any ideas ???

4
  • 1
    What's wrong with the standard login page shown at the path "/user" when you aren't logged in? Apr 4, 2013 at 15:39
  • ha ha ha ha ha... you made me sound stupid, and yes I was, I was trying to create this all day long, and it was already there... god dammit me... Anyways, thanks a lot... BTW how do I change the /user uri to /login
    – user12947
    Apr 4, 2013 at 15:44
  • 1
    You can use the path module to create an alias, BUT this particular path serves a dual function in that it's also where your user profile appears when you are logged in. So the effect may not be what you want. Apr 4, 2013 at 15:56
  • Note, the path /user/login is also provided by default Jun 25, 2013 at 2:33

4 Answers 4

2

One easy possible way to do this is you can create a node with no content and assign a url "/login" to that node and then assign login block to content region for that page only.

0
0

I entered the login as a menu-item but visible for all (just not as obtrusive as the login block). Just create a "Login" list item in your main menu (admin-interface: structure->menus->main menu->list links->add link) with path the (system) page "user/login". It will be visible for users who are not logged in, and disappear when they are. If you also enter a similar (with same weight) list-item "Logout" with path "user/logout" that will only be visible for logged-in users, and now they can easily logout as well...

You can now remove the login block that is default on your homepage.

1
  • This might be a little complex for something simple. Jan 2, 2014 at 17:27
0

Consider using either the Luxe or LoginToboggan modules, as they do exactly what you're looking for.

0

By default Drupal have a separate user login page. You can access it by using this url:

http://yoursite.com/user/login OR http://yoursite.com/user

There is no need to create separate user login page.

To redirect the user to specific page after login, you can consider LoginToboggan, Login Destination or Login Redirect module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.