By piotrdesign on
Hey guys Im working on having a horizontal login bar. So far everything is fine, all items are in 1 line but the following links:
* Register
* Forgot password?
I only mannaged them to get next to each other but I cant get them to be up with the 1st line. Can someone help me mod the user.module?
switch ($delta) {
case 0:
// For usability's sake, avoid showing two login forms on one page.
if (!$user->uid && !(arg(0) == 'user' && !is_numeric(arg(1)))) {
// Unset the time, if any. This prevents a 404 if a user relogs in
// on the page they were sent to when they logged out. See
// user_login_submit() for explanation of the time parameter.
unset($_GET['time']);
$form['#action'] = url($_GET['q'], drupal_get_destination());
$form['#id'] = 'user-login-form';
$form['name'] = array('#type' => 'textfield',
'#title' => t('Username'),
'#maxlength' => 60,
'#size' => 15,
'#required' => TRUE,
);
$form['pass'] = array('#type' => 'password',
'#title' => t('Password'),
'#size' => 15,
'#required' => TRUE,
);
$form['submit'] = array('#type' => 'submit',
'#value' => t('Log in'),
);
if (variable_get('user_register', 1)) {
$items[] = l(t('Create new account'), 'user/register', array('title' => t('Create a new user account.')));
}
$items[] = l(t('Request new password'), 'user/password', array('title' => t('Request new password via e-mail.')));
$form['links'] = array('#value' => theme('item_list', $items));
$block['subject'] = t('');
$block['content'] = drupal_get_form('user_login_block', $form, 'user_login');
}
return $block;
Comments
maybe, havent tried it but
maybe, havent tried it but try it anyway, bang this in your style sheet and see what happens, assumming your using block-user-0 login block id...
just a thought, can't see why that wont work with some mucking about with paddings, margins etc.
.item list li should be set to display inline also, thats the way to get a list to display out on one line.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
hey
THat didnt work but i changed it a bit and its almost good except the 2nd line with the Regiser and forgot pass shows up after the submit button but underneath. So we gotta fix that.
i used that code
you url would help,
you url would help, understand that without actually seeing your code in the site it's virtually impossible to trouble shoot css... as I have no idea what is going on around it, or what else you have defined in your css.
maybe just set them all to float right or left and make a clear none call as well.
understand that they are all block level elements.
if you have Firefox (which you should!) get the developer tool bar and 'see' your block level elements with the outline tool - then you will clearly see where you are going wrong.
anyone of us could do this but without an URL it's impossible.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Here is the
Here is the display
http://www.piotrpix.info/loginpanel.png
here is my code:
ok, so i mucked around with this myself.
heres the css, like i said in the first post - margins and paddings etc, this puts everything on one line. Your mistake was probably not zeroing the margins on the UL notice I set them to 4px, that overides your broswers default.
First some css...
heres a more styled version...
And for clarity's sake heres the html from the login block.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
replying to my own post
replying to my own post here, i just noticed I forgot to put in the display: inline stuff for the floated boxes...
you should use the display: inline work around to avoid the IE double margin float bug - http://www.positioniseverything.net/explorer/doubled-margin.html
Good luck!
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
So I did this and the info
So I did this and the info still appeared on the 2nd line but this time the information was right bellow the submit button with a little bit to the right.
I used this code
very cool info, thanks! I
very cool info, thanks! I wanted this for myself.
~~~~~~~~~~~~~~~~
Kris
Current project: www.cribfax.com
Ahhhh!
Ahhh it fitted in when i chaged the padding of 5 to 0
Thanks Alot!
your welcome, good luck with
your welcome, good luck with your new site:)
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
What line do I edit, so i
What line do I edit, so i have some padding at the bottom of my nav panel?
Horizontal Login Form
There is a tutorial on how to do that here:
http://www.nicklewis.org/node/845
horizontal login bar for drupal6
see the Action at http://www.ohmybaby.in
Logic:
------
1) Tell your theme to look for new template for login block
2)Create a new login block template file and render the form elements inside that
Step 1 :
Create a file called “user-login-block.tpl.php” in the following directory
“/themes /yourtheme/” .
Step 2:
Put the following code in that file.
You can create your own
Step 3:
In your template.php add the following function
function zen_classic_theme(&$existing, $type, $theme, $path)
{
return array(
'user_login_block' => array (
'template' => 'user-login-block',
'arguments' => array('form' => NULL)
)
);
}
This is for Zen classic theme . You can change it Like , “ garland_theme ” .
(i.e) “yourtheme name_theme”.
for garland users
function garland_theme()
{
return array(
'user_login_block' => array (
'template' => 'user-login-block',
'arguments' => array('form' => NULL)
)
);
}
_
There's now a module: http://drupal.org/project/userloginbar