hi i want to move login block to green area like this picture. can you hlp me?

thanks..

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Deepika.chavan’s picture

FileSize
83.78 KB

Hi,
I tried the same thing on my local site please view the attachment.
1. Added following line of code in corolla.info file :

regions[preface_right]  = Preface right

2. Added following code in page.tpl.php after </div> <!-- /#branding-wrapper --> <?php endif; ?> this line and before </div> <!-- /#header --> this line.
Code to be added in page.tpl.php is:

<?php if ($page['preface_right']): ?>     
      <div id="preface-right"><?php print render($page['preface_right']); ?></div>
<?php endif; ?>

3.Css for above regions:
3.a. Added following line of code in corolla.info

stylesheets[all][] = local.css

3.b. Created local.css file and added following css in that file:

#preface-right {
  clear: right;
  float: right;
  width: 450px; 
  margin-top:25px;
}

#block-user-login h2{
  display: none;
}

#user-login-form #edit-name, #user-login-form #edit-pass {
  width: 150px;
}

#user-login-form .form-item-name {
  float: left;
  margin-right: 20px;
  margin-top:0;
}

#user-login-form .item-list {
  display: none;
}

#user-login-form .form-type-password {
  float: left;
  margin-top: 0;
}

#edit-actions {
  float: right;
  margin-right: 25px;
}

4. Enabled 'User login' block in 'Preface right' region.( here- admin/structure/block).
5.a. Added a block in the same region after user login block. (Title field kept blank and in description field:user login form links)Added following code in the block body:

<?php
$items = "<div style='text-align:right;'>" .l(t('Request new password'), 'user/password', array('attributes' => array('title' => t('Request new password via e-mail.')))) . "</div>" ;
print $items;
?>

5 b. Php code is selected in "Text format"(after block body).
5 c. In Role setting, checked "anonymous user" checkbox.
6 Cleared cached data (here- admin/config/development/performance)

I hope the steps are clear and it helps !!

Rgrds

Deepika Chavan.

Seph’s picture

Hi Deepika,

I just saw your post and would like to do something similar, but different. I am relatively new to all this so any assistance would be appreciated. I am trying to move the logintoboggan logged in block to the bottom right of the #header_menu_wrapper next to the header menu block. I can get it to float right... either above or below the header menu block, but not next it.

Do I need to do something similar to what you just posted?

Thanks,
Seph

Deepika.chavan’s picture

Hi Seph,
Please place your 'LoginToboggan logged in block' above 'Main menu' block in 'Header menu' region (here- /admin/structure/block).
To create custom css file, add following line of code in corolla.info file.

          stylesheets[all][] = local.css

Add following css in local.css file.

#block-system-main-menu {
  clear: left;
}

#header-menu #block-logintoboggan-logintoboggan-logged-in {
  margin-top: 10px;
  float: right;
}

Please clear cached data. (here- admin/config/development/performance).
HTH !!

Rgrds,
Deepika Chavan

Seph’s picture

Thx Deepika! Worked great and gave me some insight on other things as well.

Seph

Absinte’s picture

Hi Deepika and Seph !

First of all thx for the code, it made my day !

But I have a few questions, as you can see in the attachment below :
- The connection button is not right
- I have a big space between the logo and the new form...
(- and I'm French... Sorry for my English)

Do you have any idea of what I should do to fix that ?
Thanks again !

Absinte

Deepika.chavan’s picture

Hi Absinte,
Try adding following css in local.css file :

#edit-actions {
  float: right;
  margin-right: 25px;
}

#user-login-form .form-item-name {
  float: left;
  margin-right: 20px;
  margin-top: 0;
}

#user-login-form .form-type-password {
float:left;
margin-top:0;
}

#preface-right {
  clear: right;
  float: right;
  width: 450px; 
  margin-top:25px;
}

If it is still breaking then reduce the width of '#preface-right' region or remove the left padding of '#branding-wrapper'
i.e. Change padding:45px 0 48px 25px; to padding:45px 0 48px 0;

Please clear cached data here- admin/config/development/performance .
Hope this helps!!

Rgrds,
Deepika Chavan.