21285 Posts in 5732 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1475 Views |
-
Search box - remove "search" above box

20 November 2009 at 11:05am
I used the WebPI silverstripe locally and all worked great, but when I used the other install to get my site up on my host, the search box adds the word "search" above the input field. I'm not referring to the word "search" in the input field, but just above it. How do I remove this? I did a search thru the code of the entire site and couldn't find it. Please see attached picture.
-
Re: Search box - remove "search" above box

26 November 2009 at 4:53am
That is the label on the form. Easiest way to get rid of it would be with CSS, target by ID and set display: hidden;
-
Re: Search box - remove "search" above box

21 January 2010 at 9:03am
Unfortunately the CSS addition doesn't work, as I've tried it myself. Try this though... open up your Page.php file, and remove this string of code:
$searchText = isset($_REQUEST['Search']) ? $_REQUEST['Search'] : 'Search';
That should give you an empty search box on your site, and not affect the search function. You could also replace the word 'Search' at the end of the string above with whatever you'd like it to say as well; Enter keyword, Search here etc...
Hope this helped,
Jace
-
Re: Search box - remove "search" above box

21 January 2010 at 5:56pm
Thanks Jace. Actually when I downloaded the newest Silverstripe version and installed it, "Search" was no longer listed above the search box, so they must have fixed it between versions.
-
Re: Search box - remove "search" above box

21 January 2010 at 6:29pm
/**
* Site search form
*/
function SearchForm() {
$searchText = isset($_REQUEST['Search']) ? $_REQUEST['Search'] : 'sometext or nothing';
$fields = new FieldSet(
new TextField("Search", "", $searchText)
);
$actions = new FieldSet(
new FormAction('results', 'Search')
);return new SearchForm($this, "SearchForm", $fields, $actions);
}
/**
* Process and render search results
*/change to
/**
* Site search form
*/
function SearchForm() {
$searchText = isset($_REQUEST['sometext or nothing']) ? $_REQUEST['sometext or nothing'] : 'Search';
$fields = new FieldSet(
new TextField("Search", "", $searchText)
);
$actions = new FieldSet(
new FormAction('results', 'Search')
);return new SearchForm($this, "SearchForm", $fields, $actions);
}
/**
* Process and render search results
*/
| 1475 Views | ||
|
Page:
1
|
Go to Top |




