Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I split the django-haystack search form and the results

I want to have the search form of django-haystack on the base.html template of my blog but the results on a different template page how can I do that ?

like image 424
Bunny Rabbit Avatar asked Oct 26 '11 13:10

Bunny Rabbit


1 Answers

Structure the form to submit the data to the correct URL,

      <form action="/search/?q=">
        <input type="text" name="q" id="id_q">
        <button type="submit">Go</button>
      </form>

So that code would live on the base.html page, and than submissions to it would post to the default '/search' page, the full search bar/options and results. I have this code in use on a pinax site with the default haystack install and it works.

like image 57
John Spounias Avatar answered Nov 19 '22 06:11

John Spounias