Simple search form

I need to have 2 simple search forms with different functionalities(One of the inputs should search category X and the other one should search category Y).These simple search forms are rendered in different templates.

Can you please suggest me an approach in order to this?

Thank you,
Marius

SimpleSearch now supports setting its options via the page header. So rather than setting the options globally via the simplesearch.yaml you just can provide them in the header of the page that is going to provide the search. Also I recommend you use the newer ‘page collection’ support. I need to update the SimpleSearch docs to explain this but here is an example used in the new getgrav.org site:

content:
    items: @self.children
    order:
        by: date
        dir: desc
    limit: 9
    pagination: true

simplesearch:
    route: /blog
    filters:
        - @self
        - @taxonomy: [tag]
    filter_combinator: and

If you include a simple query box on this page, it should just work:

<div class="search-wrapper">
  <a href="{{ base_url }}/blog"><i class="fa fa-times-circle"></i></a>
  <input type="text" placeholder="Enter keywords to search..." value="{{ query }}" data-search-input="{{ base_url }}/blog/query" />
</div>

Thank you. My question is if it is possible to set this for a twig template.

If I can copy-paste the simple_search folder and overwrite it(make it standalone plugin) how can I point to partials/simplesearch_searchbox.html.twig. It keeps telling me it does not find it from the new plugin. The original version is still in plugins folder. What do I need in order to get this result?

The above example I pasted is assuming this is in teh page header of the /blog page. The form submits to the same page, and because there is a query param, search is run. Becuase the filters say @self, it will use the content collection as defined by the /blog page, ie the @self.children and then filter that based on the query.

There’s no need to use the simplesearch_searchbox.html.twig file.