Apologies if this has already been answered, but I’m having a nightmare searching for the term “search”...
Anyway I’m trying to do something like this: on the search result page, have the keywords that have been searched for repopulate a new search box so that people can adjust them and search again.
The first use of the keywords variable works fine, but , the value of {exp:search:keywords} within the simple search form shows up as (for instance) “M00o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr” as presumably it’s no referring the {exp:search:simple_search}, rather than {exp:search:search_results}.
{exp:search:search_results}
{if count == 1}
<div id="search_results">
<h3>Your search for <em>"{exp:search:keywords}"</em> found {total_results} result{if total_results > 1}s{/if}</h3>
<p> <div id="search_again"><br />
{exp:search:simple_form form_id="search" search_in="everywhere" result_page="svi/results" } <br />
<input name="keywords" type="text" size="40" value="{exp:search:keywords}" /><br />
<input name="submit" type="submit" value="Search again"><br />
{/exp:search:simple_form}<br />
{/if}<br />
snip….<br />
{/exp:search:search_results}I can always set it using a variable (I’ve made a simple key value extension for moments like this) or I can set it by Javascript by putting the first use of it into a div and change the value of the keywords input that way.
But surely this is a common problem that has a better solution?
Cheers Jon