views:

87

answers:

2

Situation: In Drupal, when you use Views module, it restricts to display Search Form and Results on the same page.

E.g. Page A = (Search Form + Results).

There is no option in Views module interface to move/copy Search Form to another page. E.g. Page A = Search Form, Page B = Results Form

Question: Is it allowed by Views architecture if I have a separate Filter(Search) Form on site front page, and this form then submits search params to actual view page (which displays Results).

My original goal was to have simple search on the 1st page and then results are displayed I would show advanced search form on the second page.

Naturally, I am going to make the 1st custom form have identical fields as in original filter form so that view would understand them.

Is it a typical/accepted solution?

A: 

I can't really understand that well what you mean.

A search form that sends data to another page is perfectly compatible with the MVC pattern, as long as you keep intrests separated (databse interaction in the model, data manipulation in the controller and html in the view).

0plus1
MVC is just a pattern, but Drupal has it's own limitations, in a sense whether coding is required or not. My question was whether Drupal allows to implement such a divistion cleanly.
PHP thinker
Ok then, I misunderstood, sorry. Grayside has already answered perfectly. Next time :-)
0plus1
+3  A: 

Short answer

This is automated with the Exposed form in block setting in Views.

Longer Answer

If you want to do it from within views, set Exposed form in block under Basic Settings to "Yes". This will create a block with all the exposed filter forms. As a block you can define what region it will appear in, and on which pages.

The form in the block submits a GET request to the URL of your page view, with the query string set by the form elements you define in your exposed filters.

For example, if you create an exposed search on node title, and retain the default Filter Identifier of "title", you can always craft your own form that posts to /searchview?title=blah. I'd stick with the blocks system, myself.

Grayside
That was it! Thanks.
PHP thinker