Scenario:
WHEN User searches for a random term lets say pepe
on my initial search page.
THEN User sees the results page with lots of results.
THEN User wants to filter those results by Clicking in any of the Categories filter
THEN User sees the results of pepe
for the specific category that he selected.
Problem
I'm able to do the first search and display all results independent of category. When I try to run a 2nd search on the result's page and pass the filter category
I don't know how to make the system remember the first query or pass the value of search:title
.
How can I achieve that?
Initial Search Page
{exp:low_search:form
form_attribute="search-form"
result_page="search"
collection="article"
search_mode="all"
}
<fieldset>
<label for="keywords">Search</label>
<input type="search" name="search:title"/>
<button type="submit">Search</button>
</fieldset>
{/exp:low_search:form}
Results Page (UPDATED WITH WORKING CODE)
<!-- Category filter-->
{exp:low_search:form
form_attribute="search-form"
result_page="search"
collection="article"
search_mode="all"
remember="search:title"
query="{segment_2}"
}
<fieldset>
{exp:channel:categories parent_only="yes" style="linear"}
<button name="category" value="{category_id}">{category_name}</button>
{/exp:channel:categories}
</fieldset>
{/exp:low_search:form}
<!-- Search Results-->
{exp:low_search:results
limit="10"
query="{segment_2}"
collection="article|food"
status="open"
}
{if count == 1}<ol>{/if}
<li><a href="{comment_url_title_auto_path}">{title}</a></li>
{if count == total_results}</ol>{/if}
{if no_results}No search results{/if}
{/exp:low_search:results}