Hello.
I made a template which I am using for pretty much every page on my site. I also have the simple search form on it, which as the documentation states, allows you to choose the template (and its template group) that the search results should display on, like this:
{exp:search:simple_form search_in="everywhere" result_page="mytemplategroup/mymaintemplate"}
...
{/exp:search:simple_form}Unfortunately, it seems that I cannot get the search results to display on my main template due to how EE handles the search results template tags. If the {exp:search:search_results} loop exists on a template, no matter if it is in a conditional like below, it automatically assumes that a search has been conducted. This is forcing me to keep the search results on a separate template.
Ideally, I would like to do something like this:
{if ("{segment_1}" == "search"}
<table>
{exp:search:search_results switch="resultRowOne|resultRowTwo"}
<tr>
<td class="{switch}"><a href="http://{page_url}">{title}</a></td>
<td class="{switch}">{excerpt}</td>
</tr>
{/exp:search:search_results}
</table>
{if:else}
{title}
{body}
{/if}I also found this post from a while ago, however I do not understand it too well and it seems that the technique is dated:
http://ellislab.com/forums/viewthread/36481/
Any help would be appreciated!