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

NecroHill’s picture

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

JohnnyMoney’s picture

(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

Grum’s picture

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;
}

dabirmoghaddam’s picture

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.

alexis’s picture

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

JohnGu’s picture

Thanks very much. This is a good idea.

vronkdaut’s picture

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

adamlee’s picture

this is the correct way .. thanks

aethynyc’s picture

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