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.

Customising the CMS /

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

Form on any page that submits to standard results page

Go to End

3 Posts   1165 Views


Community Member, 99 Posts

5 May 2010 at 2:33am

I have followed

and while this works on my page of type "house" which holds and displays the results

For Example
I go to this page and "all houses" are listed and you can submit the form to filter.

Question: What would i need to do to have 'Only" the form on any givenpage.

For example I made the form appear on my by including $HouseSearchForm great :)

but the form submits to home/HouseSearchForm and doesn't show any results.

Note: On the homepage i don't want a default listing of houses to appear. I just want the form and when its submitted it would go to a result page

should i be altering the doserach() fuction

return new Form($this, 'HouseSearchForm', $fields, $actions);


Community Member, 135 Posts

6 May 2010 at 11:55am


There might be a better solution but,

What you could do is build the form in the template manually as described here:

Then you could set the action of the form to go wherever you want.

It's not ideal, but it is a solution.


Community Member, 16 Posts

19 May 2010 at 3:34am

I had to sort out a very similar problem this afternoon.
You should look at the 'setFormAction' method on the Form class.
Worked a treat for me.