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.
By kyo620724 on
Hi Guys,
Here is my website.
http://www.exceldesign.ca/ExcelDesign/
I am using zen theme and I want my search bar on the top right side.
any good idea to move it?
Thanks
Ming
Comments
Edit in tpl OR Create a region
You can use any of the following methods.
1) You can add following code in page.tpl.php
if ($search_box):
print $search_box;
endif;
if you have this code in your tpl then make sure that you have enabled search module.
2) You can also try creating a region(long method) in the theme and position it using css and then assign the search block to this region.
I tried to create account but you have enabled the admin approval for account so i am waiting for the account to get approved as you have not given search permission to the anonymous user so I can't see the search box now where it is.
Hth,
Sadashiv.
Search problem
Hi Sadashiv,
I active your account already, but I still working on the search bar. I added that code that you said in the page.tpl.php then I am looking for a search module. any good suggestion?
Well, without the module or it promts
Notice: Undefined variable: search_box in include() (line 82 of /home/content/27/10046127/html/ExcelDesign/sites/all/themes/zen/templates/page.tpl.php).
Edit template.php file In
Edit template.php file
In theme_preprocess_page of zen add search_box variable as
$form = drupal_get_form('search_form'); //get search form
$form['basic']['keys']['#title'] = 'My Search Title'; //set search title, can even make blank
$search_box = drupal_render($form); //render the form
$variables['search_box'] = $search_box; //assign it in variables
so the function would be like
This will fix the problem and you can use $search_box variable in tpl and then you can adjust the position through css.
Hth,
Sadashiv.
Thanks so mutch!
Thanks so mutch!