17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1185 Views |
-
problem with search form

2 October 2008 at 4:35am
hi everybody
I was watching the tutorial http://doc.silverstripe.com/doku.php?id=tutorial:4-site-search
and follow the steps until:
1) mysite\code page.php I put the following code:
class Page_Controller extends ContentController {
function SearchForm() {
$searchText = isset($this->Query) ? $this->Query : 'Search';
$fields = new FieldSet(
new TextField("Search", "", $searchText)
);$actions = new FieldSet(
new FormAction('results', 'Go')
);return new SearchForm($this, "SearchForm", $fields, $actions);
}
}2) templates/Page.ss within the header put:
<div id="Header">
$SearchForm
<h1>$Title</h1>
</div>3) www.mysite.com/db/build?flush=1
and fails to appear'm doing something wrong?
thanks for the help
Excuse my English
rube -
Re: problem with search form

9 October 2008 at 4:52am
Hi!
I put the code that you write in mysite/code/Page.php also in tutorial/code/Page.php because they are link (I found thi information in this forum) but I have your problem: the search form doesn't appear in the page.
Have you solve? if yes can you explain me please? -
Re: problem with search form

11 October 2008 at 6:26am
if you are running a tutorial site like ojala said, you will need to put the code in tutorial/code/page.php and you will also have to put $SearchForm in the tutorial/themes/ folder not the mysite.. thats if you're running the tutorial install.
| 1185 Views | ||
|
Page:
1
|
Go to Top |


