Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

problem with search form

Go to End

3 Posts   1432 Views


Community Member, 36 Posts

2 October 2008 at 4:35am

hi everybody

I was watching the tutorial

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/ within the header put:

<div id="Header">


and fails to appear

'm doing something wrong?

thanks for the help

Excuse my English


Community Member, 87 Posts

9 October 2008 at 4:52am

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?


Community Member, 63 Posts

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.