By ms1 on
Hi
I was wondering how to create a search-box different from the regular box that is available by default. Something like we see on http://teamsugar.com/ looks very interesting. Or basically any other impressive customization, that may make it look sleeker with rounded corners etc.
Actually I am looking to combine the search-box as well as the button into one, and place it in the header for garland theme.
Can anyone please tell me how.
(I did read through the customization tutorial at http://drupal.org/node/154137, but how to go for rounded boxes?)
Regards
Comments
Is there any method to do
Is there any method to do this? please help.
Regards
there is a method
Here is a really good howto on how to do exactly what you need: http://blog.reindel.com/2007/08/13/howto-spruce-up-your-search-box-with-...
I want to do this for one of my sites as well, but the problem is that the customization tutorial on page http://drupal.org/node/154137/, doesn't work for me. My theme is based on bluemarine.
This is the last function of my template.php (no php tags)
and this is my search-theme-form.tpl.php
I just changed the value of my button to GO! for testing purposes, but it doesn't show up, the site I'm trying it on is: http://www.forensic-centre.com/drupal/. If anyone could give me some help it would be great. When I figure it out I'll contribute a tutorial on how to do this step by step.
Thanks,
Nicolas
-----------------------
http://nic.ipwa.net
Nicolas
-------------------------
has anyone done this?
If anyone has done a custom search form, please respond to this thread, your help would be very appreciated.
Nicolas
-------------------------
http://nic.ipwa.net
Nicolas
-------------------------
It works for me
I just tried out the modification on bluemarine theme. I found it to work perfectly.
First of all, the snippet you posted is for customizing "SEARCH THEME FORM" which is present at http://drupal.org/node/45295 ( and not the location that you mentioned, i.e. http://drupal.org/node/154137/, this is for "SEARCH BLOCK FORM".)
---------------
Just to elaborate what I did. I will mention the steps.
1. Posted the snippet in template.php (which should be created for bluemarine theme as it does not have one) without the closing php tag (its not required).
2. Then I created a new file in my theme folder, called search-theme-form.tpl.php and pasted the snippet as it is.
After refreshing the screen, I find that the length of the search box increased as expected due to the modifications.
3. Then I changed the value of the button to 'GO'
i.e.
from
<input type="submit" name="op" value="SEARCH" />to
<input type="submit" name="op" value="GO" />And when refreshing the screen it comes up perfectly on the screen.
To double check I also tried the same by posting your snippet as it is (what you put in the post). It works.
----------------------------------------------
Probably there is something very miniscule that you are missing.
My guesses are
1. You are trying to configure search-block-form(http://drupal.org/node/154137) with the snippets for search-theme-form (http://drupal.org/node/45295).
2. Or maybe some naming errors in your file, like that of the new file - search-theme-form.tpl.php.
I suggest please redo the steps afresh, after removing the previous modifications.
Regards
not working
Hi I tried both theme and block code snippets.
but none of them are working for me. it is not overriding the default search block.
I have added the following block to my template.php
---
function phptemplate_search_block_form($form){
return _phptemplate_callback('search_block_form', array('form' =>$form), array('search-block-form'));
}
----
and added the following code to my search-block-form.tpl.php
--------
Search
print drupal_get_token('search_block_form'); " />
---
can you please tell me where i am missing and why its not overriding the default search block.
Regards