Hello.
I am trying to use the simple search module, so far without success.
The code that I am using is the following:
{exp:search:simple_form channel="home"}
<input type=”text” name=”keywords” id=”keywords” value=”” search_in=”everywhere” size=”18” maxlength=”100” placeholder=”Type keywords, then click ‘Search’”>
<input type=”submit” value=”Search” class=”submit”>
{/exp:search:simple_form}
I am getting the message
“Search Results:
Your search did not return any results.
Return to Previous Page”
I am clearly missing something here.
I am using version 5.3.2.
I would be grateful for any help with this.
Thanks,
Harry.
You were close- I think the problem is you’ve got search_in in the form field rather than as a parameter. Try:
{exp:search:simple_form channel="home" search_in="everywhere"}
<input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100" placeholder="Type keywords, then click ‘Search’">
<input type="submit" value="Search" class="submit">
{/exp:search:simple_form}
See docs for details. on the form- and keep in mind, fields have to be set to be searchable or the tag won’t look in them. If something isn’t coming back and you think it should, double check the field settings.
Thanks, Robin.
I checked the field settings. These were not set to “search”, so have now set them.
I then tried your suggestion of putting search_in as a parameter, but I then get the message
“Error
The page you requested was not found.”
When I put it back in the form field, I again get
“Your search did not return any results.”
I’m new to EE, so am probably missing something vital.
Thanks.
What template_group/template is the search results tag on? I suspect it’s guessing where to end up. That, or maybe there are no matches in the ‘home’ channel.
Try this:
{exp:search:simple_form channel="home" search_in="everywhere" result_page="news/searches"}
<input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100" placeholder="Type keywords, then click ‘Search’">
<input type="submit" value="Search" class="submit">
{/exp:search:simple_form}
See this bit: result_page=”news/searches”
changed it to the template_group/template where you have your search results tag.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.