Login a Little Liveler
Default User Login Block
I am using nothing fancy. It's just the User Login block placed in a region I created and called 'user_area' (and identified with css as id (user-area). My goal was... (1) use as little code as I can (2) make it re-usable so I can continue to use it and adjust it (3) keep it in the theme layer (for now).
template.php
It was a little different from the typical overides I have used, specifically I had to move up the $items. I also left in (but commented out) the print-r command I used to make the variables and arrays visible. Here's the code (basically), I used in my file.function YOURTHEMENAMEGOESHERE_theme() {
return array(
// The form ID.
'user_login_block' => array(
// Forms always take the form argument.
'arguments' => array('form' => NULL),
),
);
}
function YOURTHEMENAMEGOESHERE_user_login_block($form) {
$items = array();
if (variable_get('user_register', 1)) {
$items[] = l(t('sign up!'), 'user/register', array('attributes' => array('title' => t('Create a new user account.'))));
}
$items[] = l(t('get help!'), 'user/password', array('attributes' => array('title' => t('Request new password via e-mail.'))));
$output = '';
//print "<pre>";
//return print_r($form);
//print "</pre>";
// Our kickin' mods go here.
$form['name']['#title'] = t('Member');
$form['pass']['#title'] = t('Combo');
$form['links'] = array('#value' => theme('item_list', $items));
$output .= drupal_render($form);
return $output;
}
The CSS
The rest of it came in the form of some CSS. Here is the 'basics' of what I used... it doesn't have all of the images, but it has enough of the good stuff to make it work.#block-user-0 input.form-text,
#block-user-0 input.form-submit,
#block-user-0 textarea,
#block-user-0 .form-item label {
float: left;
color: #424242;
}
#block-user-0 .content {
margin: 0;
padding: 0;
}
#block-user-0 input.form-text {
margin: 0 .5em;
}
#block-user-0 input.form-submit {
margin: 0 .5em;
background: none;
border: none;
outline: none;
color: #424242;
}
#block-user-0 input.form-submit:hover {
color: #AA893F;
}
#block-user-0 .item-list ul li {
display: inline;
padding: 0 20px 0 10px;
float: left;
}
#block-user-0 .item-list ul {
display: inline;
float: right;
}
#block-user-0 .item-list ul li a {
color: #424242;
font-size: 80%;
}
#block-user-0 .item-list ul li a:hover {
color: #AA893F;
}
#block-user-0 label {
padding-left: 10px;
}
#user-area #block-user-0 {
padding-bottom: 10px;
}
I'm still doing some adjustments and playing with some of the values... we'll see where it takes me.



Comments
image broken
I'm not seeing the image of the endresult, instead Im looking at a text string: [inline:=newlogin.png]
thank you
yep... my terrific typos, the inline image module usage should be "[inline:nameoffile]" thanks for the heads up :)
You probably spent quite a
Geesk and God..
"I'm working on attempting to reverse engineer how the login works on the Geeks & God Drupal site (top right)... almost got it down. It's done pretty much exactly as you have here, with some jQuery added on for cool factor :D It handles toggling the search form as well."
How is this going? I haven't seen any progress on your Geeks and God Site.
Rob
--------------
Seiko Ananta
Best
Hello Austin,
I'm using Drupal for my site but am not good at php,still then I'll try this.Thanks for this nice article.
Macken,
Computer Desks For Home
Abercrombie Jeans
Thanks a lot for such good
Thanks a lot for such good enough note connecting with this good topic.Cheap laptops
Its amazing to see such a
Its amazing to see such a great post i like his albums and i need best personal coach to practice music that keep me good thanks for sharing.Online logo design
We have been selling prom
Submitted by Rob Parks (not
Tools include both simple
Replica Watches Fake
replica rolex
Very informative and
http://www.rhineweddingstore.com
China Wholesale Wholesale
Free Premium Drupal 6.x
High quality fake rolex
High quality fake rolex
abercrombie
abercrombie
Crystal Jewelry,Crystal Necklace,Handmade Crystal Jewelry,Wholes
Adidas Shoes Online Shop-Hot
There are a few things in
tag heuer watches tag heuer
I know a very nice prom
fashion style vogue
http://www.excelwatch.com
http://www.excelwatch.com
replica Rolex Yachtmaster
Post new comment