Drupal 7 with Horizonal Login Bar


In Drupal 7, I would like to have horizontal login block instead of the original one. Searched around and it seems like it's quite difficult to find one. But then, I found it at Victheme.com. It seems to work according to the instruction. However, as misteryes commented on that page that you can type in the password input box and hit Enter in Firefox.  By hitting Enter in Internet Explorer (IE), it will not work. Nothing happen. I tried that with Safari 6.02 and I also got that problem. I, then, follow what misteryes instructed in the CSS file.

In this tutorial, I did not do anything with template.php per duckz instructed. What I did was to put the whole code into a new block. Set the Text Format to PHP Code. it will works just fine. Then, put that block to the area that you want it to appear. Below is what I did.

1. Start by create a new block, then, put below code into it. Do not forget to set Text Format to PHP Code. If you do not see PHP Code Text Format, you have to enable PHP filer in the module page first.


function horizontal_login_block($form) {
  $form['#action'] = url($_GET['q'], array('query' => drupal_get_destination()));
  $form['#id'] = 'horizontal-login-block';
  $form['#validate'] = user_login_default_validators();
  $form['#submit'][] = 'user_login_submit';
  $form['#prefix'] = '<div id="loginbar">';
  $form['#suffix'] = '</div>';
  $form['name'] = array(
    '#type' => 'textfield',
    '#prefix' => '<div class="usericon">',
    '#suffix' => '</div>',
    '#maxlength' => USERNAME_MAX_LENGTH,
    '#size' => 15,
    '#required' => TRUE,
    '#default_value' => 'Username',
    '#attributes' => array('onblur' => "if (this.value == '') {this.value = 'Username';}", 'onfocus' => "if (this.value == 'Username') {this.value = '';}" ),
  $form['pass'] = array(
    '#type' => 'password',
    '#maxlength' => 60,
    '#size' => 15,
    '#required' => TRUE,
    '#prefix' => '<div class="passicon">',
    '#suffix' => '</div>',
  $form['actions'] = array('#type' => 'actions');
  $form['actions']['submit'] = array('#type' => 'submit', '#value' => '');
  return $form;

function login_bar() {
  global $user;
  if ($user->uid == 0 ) {        
   $form = drupal_get_form('horizontal_login_block');
   return render($form);
  } else {
   // you can also integrate other module such as private message to show unread / read messages here
   return '<div id="loginbar"><p>' . t('Welcome back ') . ucwords($user->name) . '<p></div>';

// Print out the login block into the screen
print login_bar();



2. After put the code in the block, you still need to do the custom CSS. Put below CSS in your theme custom file :

/** Login Bar **/
.usericon, .passicon {
float: left;
width: 180px;
height: 24px;
#loginbar {width: auto; float: right;}
#loginbar .form-actions {position: absolute; z-index: -99;}
#loginbar p { color: #fff; font-size: 1.1em; font-weight: bold;}


Once done, try it, you will see the login block as below:

Drupal 7 - Login Bar

Note :

  1. In Zerotheme, round corder CSS will work with in Search Area, not Banner Area.
  2. Here is the PHP Code that you have to select while create a new block to make this works  :

Drupal 7 - PHP Code - Text Format

Software Tested :

  • Drupal 7.17
  • Zeropoint Theme 7.x-1.4

Reference :

  • http://www.victheme.com/blog/drupal-7-creating-horizontal-login-bar-without-module


So, the best choice is to simply cross for an Anti Snoring wristband from Sleep Connection wristband. Not most effective is it certainly effective, however it is also one of the maximum convenient answers you may in all likelihood ask for. https://www.smore.com/4zujv-sleep-connection-review-must-read Compared to other options in the marketplace, you received’t should undergo the hassle of all the bulky device. Not to mention, it’s completely secure and risk-free! You don’t ought to take a number of medicine because all you have to do is put on it and you’re prepared!

XtraZex gives the fundamental dynamic substances and minerals required for the best possible working of the male private parts. A decent grouping of such fixings guarantees the ideal enhanced visualizations, and furthermore, we don't hazard anything. https://lasciencecoalition.org/de/xtrazex-erfahrungen/ Various examinations and perceptions have indicated that it is a protected item. No sign to the opposite has been affirmed.

The schools reduce through the instructional ranges making sure that you don’t should move to other regions to discover great schooling on your kids. https://www.parccentralresidence-official.sg Schools like kindergarten and nurseries are inside the place supplying proper take care of your young ones. Here are some of the faculties round Parc Central Residences.

The Dreamfarm Garject Garlic presses is a chromed zinc body with nylon strip discharge catch and scrubber. It assists with crushing numerous cloves in one go. You simply need to press the individual catch and toss them straightforwardly to the canister. Moreover, https://thestylekitchen.com/best-garlic-presses/ you can just flush this Garlic chopper under the water to evade the wreck.

In case you use Gmail's compact structure, https://getpva.com/ you unquestionably understand the Smart answer feature that licenses you to successfully respond with intelligent responses in a message. This part progressed toward Gmail a year prior on your work territory to save you from unwanted keystrokes when you simply need to watch that your social event time is ideal for you.

Tokyo, the Japanese capital city gained the bid to host the 2021 Summer Olympic Games, beginning from July thru August, in 2021. https://www.ultimate-guitar.com/u/olympiclive Out of the numerous bids for hosting the esteemed worldwide carrying occasion, the IOC ultimately quick-indexed Istanbul (Turkey), Madrid (Spain) and Tokyo (Japan) for the threat to host the 2021 Summer Olympics.

They're great for getting your mind working and getting faster in all kinds of daily activities, and they're an interesting challenge to take on. Are you ready for it? Come on! You will certainly seek them out. <a href="https://raadsels.info/leuke-raadsels/">leuke raadsels</a>

great work man i would like to congratulate you on this effort <a href="https://crimescenecleanup.cleaning/crime-scene-cleaning-el-paso-tx.html"...

Most of the people all across the world are using either a laptop or mobile phones and it will get dirty and flooded with dust that you may see rarely. Therefore, we have something for you that will help you out to clean the monitor of your laptop in no time. The White Screen is the site that provides you with some full-screen colors, as you can see on this page, to spot the tiny dust particles and dirt that you can’t see with your eyes directly.

Thanks for sharing this amazing information <a href="https://www.filorgahk.com/">柔滑亮澤面膜</a>

Medicinal plants are considered as those resources of ingredients, which may be utilized in drug development either pharmacopoeia, non-pharmacopoeia. Moreover, some plants are considered as important source of nutrition and as a result of that, they're recommended for their therapeutic values. <a href="https://mukti-119.com/">https://mukti-119.com/</a>

먹튀는 자신의 것이아닌 타인의 것을 받은채 대가를 치르지않고 자신의 수익만을챙겨 가버리는것을 말하는 겁니다. 먹튀 “먹고 튀다” 를 줄여서 부르는말로 그냥 자기이익만 챙겨 도망간다는 말을 뜻하는것입니다 <a href="https://safe-playground.com/">안전공원</a>

In this tutorial, I did not do anything with template.php per duckz instructed. What I did was to put the whole code into a new block. Set the Text Format to PHP Code. it will works just fine. Then, put that block to the area that you want it to appear. Below is what I did.

Your one-stop shop for expert beauty advise, authentic product reviews, and original makeup products all vetted by our editors and the industry's top pros. https://beautyhooked.com/

Rice Purity Test is the survey that is the amalgam of 100 questions related to your life. that decide your personality/Innocence related to educations, society and your life. https://telegra.ph/Are-you-as-innocent-as-you-think-06-01

You can download free accounting software here <a href="https://www.qne.com.my/increase-profits-with-free-accounting-software-in... PROFITS WITH FREE ACCOUNTING SOFTWARE IN MALAYSIA</a>

Nice post,i like your article,great way of explanation.Looking for more articles like this, Also check my website which is about dead pixel test

Control dust, stabilize soils, and build roads in just days no matter the industry you´re in.Decrease your operational costs, improve productivity, get results <a href="https://www.irriot.com/produkter/fjarrenhet/">jordfuktighetsmätare</a>

We want you to have an increasingly fuller, healthier life, so we have compiled, in Build your body the best beauty, health, fitness and nutrition tips <a href="https://mukti-119.com/category/%eb%a8%b9%ed%8a%80/">먹튀</a>

t is included in my habit that I often visit blogs in my free time, so after landing on your blog. I have thoroughly impressed with it and decided to take out some precious time to visit it again and again. Thanks <a href="https://safe-playground.com/">https://safe-playground.com/</a>

I’m amazed, I have to admit. Seldom do I encounter a blog that’s both equally educative and interesting, and let me tell you, you’ve hit the nail on the head.
<a href="https://www.beautymaxx.co.uk/40-k-blasting-fat-rf-multipolar-slimming-ma... slimming instrument</a>

Hair and Hair hair transplant in Islamabad has the most dedicated staff to treat our respected patients. Our clinic is equipped with international standard services and up-to-date gear and technology.

온라인 클럽은 기본적으로 가상 랜드 클럽입니다. 게임과 표준은 비슷할 수 있지만 기후와 절차가 변경되어 온라인 도박 클럽이 무료 요소가됩니다.
이것은 웹상의 온라인 도박 클럽에서 라스베가스의 육상 클럽에서 전문적인 플레이어 일 수 있지만 완전히 다른 게임임을 의미합니다. <a href="https://supergammer0.blogspot.com/2021/07/blog-post.html">최고의 온라인 카지노 및 도박 팁 및 기사</a>

There are many dissertation web sites on-line as you furthermore acquire simply said within your internet site. <a href="www.actingwithmax.com/">Acting Schools</a>

Best traveling tips here at <a href="https://simplyretireearly.com/">Simply Retire Early</a>

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.