Community & Support

how do we remove the text "Search this site" from the search box

In my search block on the home page the search box is preceded with the text "Search this site", what is the preferred way to remove that text? thanks -chris

Comments

I switched it off via css,

I switched it off via css, just added 'display: none;' for label for the search block

(Thanks for the ideas)

(Thanks for the ideas) Adding this to my main css file works for me:

#edit-search-block-form-1-wrapper label
{
display: none;
}

*****************************
Drupal Video Tutorials (Spanish)
www.drupalcarmen.com

*****************************
Drupal Projects Homepage (English): www.grandmacarmen.com
Drupal Video Tutorials (Spanish) : www.drupalcarmen.com

Also for the theme search box

That works fine thanks.

For completeness, there is also the search box you can enable in the theme configuration, so I added this as well:

#edit-search-theme-form-1-wrapper label
{
display: none;
}

Go through these steps to remove the label from the search box:

1. Go to the "modules/search/" directory.
2. Open the file "search.module" with your preferred text editor.
3. Search for the phrase "search this site".
4. Comment the containing line out. (put "//" at the beginning of the line).
5. Save the file and refresh your browser.

You should not modify core or contributed modules

The right way to do it would be overriding the theme function:

overriding theme output.

Alexis Bellido
Ventanazul: web development and Internet business consulting shouldn't be boring

Thanks

Thanks very much. This is a good idea.

InteMatrix ——DigiMarketing services,include Drupal&Magento!

no good idea

I don't think, it is a good idea to comment out lines in a core module!
That's what all the system of overrides in drupal is good for - to not to have to make changes in existing contributions, but keep the individual customization cleanly separated.
What happens to your "fix", with the next update?

Here IMHO "better" ideas how to handle this:
http://drupal.org/node/224183

this is the correct way ..

this is the correct way .. thanks

"Correct" way to do it

Just follow this guide, its MUCH easier than than the other drupal guides.

It tells you exactly what to do. Basically just copy a file from your core search modules folder into ur theme folder and then copy this guys code into the template.php page

http://drupal.org/node/45295