By czarphanguye on
Dear Drupal.org,
I am trying to create a horizontal login for my Drupal powered website (v4.5.2).
The code to make your own login area is:
<?php
if (empty($edit)) {
$edit['destination'] = $_GET['q'];
}
// NOTE: special care needs to be taken because on pages with forms,
// such as node and comment submission pages, the $edit variable
// might already be set.
$output .= form_hidden('destination', $edit['destination']);
$output .= form_textfield(t('Username'), 'name', $edit['name'], 15, 64);
$output .= form_password(t('Password'), 'pass', $pass, 15, 64);
$output .= form_submit(t('Log in'));
$output .= "</div>";
$output = form($output, 'post', url('user/login'));
return $output;
?>Which creates something extacly like the login block by default:
--------------------
| [=======] |
| |
| [=======] |
| |
--------------------I would like to display this login block like:
-------------------------------------
| [=======] [=======] |
-------------------------------------Any tips?
Comments
The easiest way to do this
The easiest way to do this is probably by using CSS. Look at the HTML code you get: the form items are surrounded by DIV tags using the class 'form-item'. You can use 'display: inline' for the class 'form-item' in your CSS file, that should display the form items one beside the other.
Fiddle around with the CSS a bit, it should take you where you want to go.
--
Rochus Wolff - heterocephalusglaber.de
Check the custom login in
Check the custom login in the PHPTemplate snippets repository.
Thank you, very, very
Thank you, very, very much.
Regards,
Czar ['at'] Czarism.com
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)
)
);
}
I need a horizontal Login Bar ,,, Zen ,,, Droupal 7
I am in need of a login bar for Droupal 7 with the latest version of the Zen StarterKit theme...
I could settle just for buttons that just redirected to the logon page and once logged gave a message and a prompt to log out.
But I want to know how to do the horizontal form...
I'll put this here as it took me ages to find this
Fairly straight forward solution:
http://www.victheme.com/blog/drupal-7-creating-horizontal-login-bar-with...
Both functions go into template.php while
print login_bar ();works in page.tpl.php.Hopefully will stop you having to try various more complex methods.