By unxposed on
Hi,
I've set up my own sub theme of zen classic. In my page.tpl.php file I have
<?php print $search_box; ?>
But how do I change the html of this ... for example I want to change the value of the input to 'search this site', as well as adding a couple of divs so I can add some custom syling.
I've searched for this but don;t seem to be able to find any instructions, does anyone know any links or could tell me how to do it?
Thanks!
Comments
A link anyone?
A link anyone?
Okay so if I change
Okay so if I change '#default_value' => '' To what I want in the core search.module then this appears on my site - obviously I don't want to change the core. So how would I go about changing this in templates.php in my theme?... Would I need to add any new .tpl.php files? And how would I go further to add new div's around the search box - I can;t see any reference to the divs that are created in the core files?
Just simply copy the file
Just simply copy the file
search-theme-form.tpl.phpfrommodules/searchdirectory to your theme folder.Open the file, there are instructions and explanations inside on how to override the search form.
-----
http://kahthong.com - A blog, portfolio & personal site
My blog is proudly powered by Drupal
Thanks
Great thanks!
I've copied the search-theme-form.tpl.php into my sub theme directory and changed the code to
This is great as I can add new div's to the search box. but does't address tweaking the finer detail. i.e. I have the variable $search['search_theme_form'] which prints a div with class of form-item, a label, and an input box of:
What if I want to change value="" to value="Search this site"? How would I go about changing this. Or if I wanted to remove the div with class of form-item, which to me seems a bit reundent, and possibly add some paragraph tags in its place?
From what I've read I need to paste a funtion from search.module in my theme template.php, changing a few details, but I just can't find which bit I need to copy, or what needs changing... Any help would be really appreciated. Here are a few things that may be relevent in search.module:
Thanks in advance!
No you don't have to go into
No you don't have to go into those details and functions.
Please refer to how I did for my Agregado theme:
-----
http://kahthong.com - A blog, personal and showcase site
My blog is proudly powered by Drupal CMS
Amazing!
Thanks so much.
This seems to easy! : )
Is this considered best practice?
Thanks!
Not sure about best
Not sure about best practices though.. But its easier than creating function overrides, etc etc..
=)
-----
http://kahthong.com - A blog, personal and showcase site
My blog is proudly powered by Drupal CMS