Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
How do i add a search block in the header portion. Like we have a logo in the header on the left side , then I want a search block on the right side. On the standard Drupal themes this is possible , please tell how to insert search on the right side.
Comments
Comment #1
kunal981 CreditAttribution: kunal981 commentedI did it :)
Comment #2
kunal981 CreditAttribution: kunal981 commentedHello, I am not a designer just tried a few things and thankfully it worked for me.
1. I enabled the search module from admin .
2. Went to position the search block in the header , but Sky didn't have a header positioning.
3. So i made changes to page.tpl.php
4. Inside the div labeled as header i placed the code
if ($search_box):
print $search_box ;
endif;
5. This code basically tells that if search module is enabled place it here.
6. In style.css file i coded for the id ="search-floater" and code for it is
#search-floater {padding-bottom: 5px;position: relative;float: right;margin-top: 80px; margin-right:04px; width: 190px;z-index: 1; }
7. This is all i did Hopefully it will be helpful for u too.
Comment #3
JacineHi kunal981,
The Sky theme doesn't feature a search box in the header as part of its design, but the way you added it yourself would be the right way to go about it. Just wanted to let you know that.
Comment #4
nxqamar CreditAttribution: nxqamar commentedalso make sure search box is enabled in theme configure settings. It wasted quite an hours for me.
Comment #5
pmathur01 CreditAttribution: pmathur01 commentedHi,
I am new to theming drupal. I did add the code in page.tpl but what are the steps that i need to add in style.css? Can someone elaborate..
thanks
Comment #6
paul555 CreditAttribution: paul555 commentedsubscribing