I noticed that alot of people had requested information on how to change the text next to the search form. Also, there were quite a few requests asking how to put default text in the search box. I am new to coding and figured this could be a feature that I could probably tackle. Sure enough it was. This should make changing of this text much easier for the newbs (aka me and others) but it still shouldn't affect themers or any other modules in any way. I have attached a patch for the search module. I did this patch on 6.9, but I don't know why it wouldn't work on 6.10. I understand that this is kind of unnecessary, but I believe it will be of help to alot of people. Please remember that this is my first contribution and I am new to coding.
| Comment | File | Size | Author |
|---|---|---|---|
| searchmod.patch | 3.7 KB | jweberg |
Comments
Comment #1
jweberg commentedI just figured out that this patch doesn't use the base drupal directory. I tried a few times and was unable to get it to work. Maybe someone can help me out with that.
Comment #2
jweberg commentedI was just reading over some documentation and I was thinking maybe I should make this a module and use hook form_alter. Like I said I am new to coding and don't know how to go about this exactly. Maybe someone could help me out. I don't like the default and would like to use this on all my sites. Thanks.
Comment #3
jhodgdonYou can already completely override the search box via theming, so we won't be doing this. Sorry...
Comment #4
joris.verschueren commentedsurprising discussion.
I was also looking for hints on how to alter the text next to the search box and I was going to suggest a "toggle on/of" function for this, so as to avoid messing (as I've done before) with themes and module code, but this patch is definitely better.
I'm rather surprised that this feature will not be included "because there's already a harder way to do this". I thought that, with every version, Drupal was growing more customisable, user-friendly and relying on GUI, so I should think this is worth including. Why would a user-friendly option be discarded in favour of overriding via theming?
Therefore, I hope that this might be picked up in a next version.
Yours,
Joris
Comment #5
jhodgdon"messing with themes" and hook_form_alter() are the Drupal Way to customize things. Sorry. There is also a contributed module that will let you change text on forms without writing your own module:
http://drupal.org/project/stringoverrides
Much more flexible than the patch above, and accomplishes the same thing.
And for your future information, if you want to request features for Drupal:
a) Request it for Drupal 8 at this point (or whatever the newest non-released version is). New features are not accepted any more (just bug fixes) for Drupal 6 and 7.
b) Make sure the proposal is similar to how other parts of Drupal work.
Comment #6
joris.verschueren commentedThanks for replying. I was already doubting whether it was ok to reopen this feature request.
and thanks for the solution.
Joris