• Top class table-less, CSS designs
  • Highly optimized for performance
  • Various theme configuration options
  • Themes with installation profile
  • Free E-mail support
PSD to Drupal
PSD to Drupal

Get your design converted into world class Drupal theme by Drupal experts. Our PSD to Drupal service starts from just $599.

More details

User login

Recent comments

Remove/Change search this site label in Drupal search form

In this article I will show you how to remove Search this site: label from Drupal's search form. Drupal add search form to a site in two ways. One way is the theme's search form which is rendered by placing $search_box variable anywhere in the theme's page.tpl.php file. And other ways is search form block that you can place to any available block region.

Removing label from theme's search form

First will will tell you how to replace Search this site: from themes search form.

    <div class="container-inline">
        <?php
$search["search_theme_form"]=str_replace('value=""', 'value="Enter your search term..." onblur="setTimeout(\'closeResults()\',2000); if (this.value == \'\') {this.value = \'\';}"  onfocus="if (this.value == \'Enter your search term...\') {this.value = \'\';}" ', $search["search_theme_form"]);
$search["search_theme_form"]=str_replace(t('Search this site:'), '', $search["search_theme_form"]);
 
  print $search["search_theme_form"];
  print $search["submit"];
  print $search["hidden"];  
        ?>
    </div>

Create a file named search-theme-form.tpl.php in your themename directory and add following code to it:

Removing label from blocks's search form

Now, its time to do the same this for block search form. Create a file named search-block-form.tpl.php in your themename directory and add following code:

    <div class="container-inline">
        <?php
$search["search_block_form"]=str_replace(t('Search this site:'), '', $search["search_block_form"]);
 
 
  print $search["search_block_form"];
  print $search["submit"];
  print $search["hidden"];  ?>
        <?php if (isset($search['extra_field'])): ?>
        <div class="extra-field">
            <?php print $search['extra_field']; ?>
        </div>
        <?php endif; ?>
    </div>

Comments on this post

jamirawan

Is this for your premium theme or for drupal in general?

Author

Its in general for Drupal

Custom Project

If you are looking for a Custom Drupal theme or Drupal project developer, you can contact us to get a quote.

Contact

Theme customization

We offer affordable Drupal theme customization service. You can use this service to let us customize your theme.

Drupal organization member
Paypal verified

Recent Free Themes

Recent Articles