Move Search to Top-Links Region - Need Help Please

I have moved the Search Box in the Top-Links area.

To do so, I modified the /stingray/page.tpl.php file to move the search box code from the Header to the Top Links region.

The new Top-Links template code now reads:

/*
* <?php if ($toplinks): ?>
*
*
* <?php if ($search_box) { ?>
*
* <?php print $search_box ?>
*
* <?php }?>
*
* <?php print $toplinks ?>
*
* <?php endif; ?>
*/

My problem is that the search box and button are dropping down below the black background, and I want it to appear inline with the Login/Account block I've placed there (using the Account Menu Module).

I know, from inspection with Chrome's "Inspect Element" function, that the Search Box/Button inherit their properties from Drupal's formatting for the search form.

However, I'm a little stuck about how best to override that for just this one instance. Any help you guys can offer would be much appreciated!

Thanks

Tags:
Laxden's picture
Offline
Joined: 08/23/2011

Sorry for some reason the forum won't let me include all the template code, even when commented out.

Laxden's picture
Offline
Joined: 08/23/2011
Rob D.'s picture
Offline
Joined: 04/09/2008

The first method should work (rearranging page.tpl.php), you'll just need some css:

#top-links {
padding: 5px 0 0 0;
background: #000000 url(../images/style1/toplinks-bg.png) top repeat-x;
}

#search-box {
padding-top: 0px;
}

#search-box .form-item, #search-box .form-submit {
margin-bottom: 0;
margin-top: 0;
}

Laxden's picture
Offline
Joined: 08/23/2011

Thanks for the help! You guys rock.

I modified your suggested CSS slightly (my top-links area is right-aligned), and it works perfectly.

Here's the code I used:

#top-links {
line-height: 24px;
margin-right: -10px;
padding: 15 0;
background: url(../images/style6/toplinks-bg.png) repeat-x;
border-bottom: 1px solid #4d4d4d;
}

#search-box {
float: right;
padding-top: 0px;
font-size: 11px;
color: #71A2CD;
}

#search-box .form-item, #search-box .form-submit {
padding: 0 5px;
margin-bottom: 0;
margin-top: 0;
}

Support hours: 9AM - 5PM EST, Mon - Fri

Follow us on: