Closed (won't fix)
Project:
Custom Search Box
Version:
6.x-1.1
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 May 2009 at 17:21 UTC
Updated:
24 Jun 2010 at 11:46 UTC
hi, is there any plans to be able to remove the 'colon' after the 'Search this site' text. I was hoping this module would have provided it.
*goes back to the ranks of people who are frustrated with core search block*
Comments
Comment #1
jweberg commentedThis module does provide that. You can actually change that text to whatever you want.
Comment #2
milos1234 commentedstrange, because when i change the text, the colon remains
ie drupal default = "Search this site:"
change text to "Custom search text"
result = "Custom search text:"
Comment #3
jweberg commentedIs anyone else having this issue?
Comment #4
jweberg commentedI just tested this on one of my sites, and it did happen. Don't know how I missed it before. Not sure how to fix this. I'll look into it.
Comment #5
jweberg commentedIt appears that the reason the colon is there is because the field is a label. I'm not sure if this is something I want to fix. It currently just adds a field to the label of the form. To change this I would have to change the form. Most people leave that field blank and use the default text instead.
Comment #6
jweberg commentedComment #7
netsensei commentedYou should take a look in form.inc: theme_form_element() themes the form element (input/select/... + label). You'll notice this line:
$output .= ' <label for="'. $element['#id'] .'">'. $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) ."</label>\n";You could override this function in your own template.php. Next you want to change the '!title: !required' part and remove the colon. Beware though: this breaks gettext support because most translation packages are generated against the default '!title: !required' string.
Comment #8
akalata commentedIf you want your search box label to already have punctuation, and not a colon after that ("What?" instead of "What?:"), you can use the theme function described at http://drupal.org/node/376345#comment-1743344.
I was also able to quickly adapt that theme function with an extra if statement to check if the label text matches the text you've specified in the Custom Search Box settings box. Of course, this means that any labels with that text will be treated the same, so this might not be your ideal solution:
Comment #9
DreeStyler commented#7 -> Nice one!
Simple, functioning.
Comment #10
DreeStyler commented