By knpwrs on
I am making a theme and I am currently attempting to theme the search box.
The default search box is as follows:
<input type="text" maxlength="128" name="search_theme_form" id="edit-search-theme-form-1" size="15" value="" title="Enter the terms you wish to search for." class="form-text" />
How do I remove the following?
- size="15"
- class="form-text"
I am assuming that I have to go through the template.php file, however, I cannot find any helpful suggestions in the articles on how to theme the search box.
P.S. If somebody could also tell me how to get rid of the label right above the textbox, that would be greatly appreciated.
Comments
The easiest way is to overide
The easiest way is to overide the search-theme-form.tpl. In that file you can control both size and label.
I'm still not seeing how
I'm still not seeing how exactly to do this...
I have the search-theme-form.tpl.php in my theme's folder
What code should I use to get the alterations I want?
in the tpl file you can
in the tpl file you can rewrite the whole html output for the search box and in your case omit the size..etc
Steps:
Add this to template.php in your theme folder
then in search-theme-form.tpl.php put your search box as you want it to be
eg
Now anywhere you put
<?php print $search_box; ?>in your page.tpl.php, the search box you write will be rendered.lets see if this work
thanks