How to create a custom user login bar
Create a custom user login bar
Task · How to create a custom user login bar · Site administrators · Themers · Drupal 5.x · No known problems
Last modified: August 26, 2009 - 01:20
In this how-to, I will show you how to create a user bar, that:
- Displays a compact, nice user login form that can fit in one line.
- Once user is logged in, It will display a welcome message and a couple of helpful links.
This is the final result we will be trying to achieve:
As you can see, this how-to is written for Garland theme, the default theme for Drupal 5. But I'm pretty sure it can be easily used in any other theme.
Decide on the approach..
Drupal is very powerful, it's so flexible that you have many ways to do things. That's why a 5 minutes of thinking is very recommended before we get our hands dirty.
The solution I thought of will work like this:
- We will write a separate function, will call it garland_user_bar(). It decide, and return HTML for the login form, or the welcome message. It will contain the necessary code to check which one it should return.
» 30 comments · Read more


