Не могу понять, как форму авторизации поменять, чтобы в строчку выводилась..
Такие же вопросы возникают в обычных формах, при создании форм с помощью модуля webform. Конечный вариант получается стандартно: название поля - ниже, под ним поле ввода информации. А мне надо чтобы сразу в одну строку все было.
Ну вот, как на примере..
Не ругайте сильно - ну не могу я понять..
Вложение | Размер |
---|---|
![]() | 5.29 КБ |
Комментарии
Модуль userloginbar, может сгодится? А вообще темизация.
Ну вот WebForm в одну строку http://vsenovosti.in.ua/send/news
см. css
css
это все решается с css
не нужно веб формы и темизация (первый вариант слишком большой, второй ввегнет в столбняк ТС )
хотя можно и темизацией, и потом выводить просто выводить в строку
вот
держи
в template.php пишешь
$form = array(
'#action' => url($_GET['q'], array('query' => drupal_get_destination())),
'#id' => 'user-login-form',
'#validate' => user_login_default_validators(),
'#submit' => array('user_login_submit'),
);
$form['name'] = array('#type' => 'textfield',
'#title' => t(''),
'#maxlength' => USERNAME_MAX_LENGTH,
'#size' => 15,
'#required' => FALSE,
);
$form['pass'] = array('#type' => 'password',
'#title' => t(''),
'#maxlength' => 60,
'#size' => 15,
'#required' => FALSE,
);
$form['submit'] = array('#type' => 'submit',
'#value' => t('Login'),
);
$items = array();
if (variable_get('user_register', 1)) {
$items[] = l(t('Create new account'), 'user/register', array('attributes' => array('title' => t('Create a new user account.'))));
}
$items[] = l(t('Request new password'), 'user/password', array('attributes' => array('title' => t('Request new password via e-mail.'))));
$form['links'] = array('#value' => theme('item_list', $items));
return $form;
}
function custom_user_login_blocks_output() {
global $user;
$output = '';
if(!$user->uid){
$output .= '<div class="loginform-position">'.drupal_get_form('custom_user_login_blocks').'</div>';
}
print $output;
}
а в шаблоне вызываешь
<?php custom_user_login_blocks_output(); ?>
это если отдельно без блока.
дальше css тебе поможет (а файле стилей твоей темы)
а именно
display:inline;
margin:0;
padding:0;
}
если что непонятно - пиши в личку
Почитайте тут
Спасибо! Для авторизации это то, что нужно.
_____
Вопрос по формам пока остается открытым. Но до него пока не добралась, буду решать дальше проблемки по мере возникновения ))
Вам выше t1mm1@drupal.org написал решение. Скопируйте первый код в template.php, а второй - .css файл. Эти файлы находятся в папке Вашей темы оформления.
Выдает ошибку:
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'custom_user_login_blocks' was given in M:\home\site.ru\www\includes\form.inc on line 372.
Видимо что-то все-таки делаю не так... ((
попробуйте не трогать template.php, а в .css кусок добавить.
аааааааааааааааа
я тупанул там
ча исправляюсь исправляюсь =)))
$form = array(
'#action' => url($_GET['q'], array('query' => drupal_get_destination())),
'#id' => 'user-login-form',
'#validate' => user_login_default_validators(),
'#submit' => array('user_login_submit'),
);
$form['name'] = array('#type' => 'textfield',
'#title' => t(''),
'#maxlength' => USERNAME_MAX_LENGTH,
'#size' => 15,
'#required' => FALSE,
);
$form['pass'] = array('#type' => 'password',
'#title' => t(''),
'#maxlength' => 60,
'#size' => 15,
'#required' => FALSE,
);
$form['submit'] = array('#type' => 'submit',
'#value' => t('Login'),
);
$items = array();
if (variable_get('user_register', 1)) {
$items[] = l(t('Create new account'), 'user/register', array('attributes' => array('title' => t('Create a new user account.'))));
}
$items[] = l(t('Request new password'), 'user/password', array('attributes' => array('title' => t('Request new password via e-mail.'))));
$form['links'] = array('#value' => theme('item_list', $items));
return $form;
}
function custom_user_login_blocks_output() {
global $user;
$output = '';
if(!$user->uid){
$output .= '<div class="loginform-position">'.drupal_get_form('custom_user_login_form').'</div>';
}
print $output;
}
ошибка была тут
drupal_get_form('custom_user_login_form')
а вызывали другую функу.
ча работает )