mydomain.com/public/assets/snippets/ajaxSearch/templates/layout.tpl.html
[+as.showForm:is=`1`:then=`
<div id="HeaderContainer_search">
<div id="HeaderContainer_client_login">
<a href="client-login.html"><img src="http://www.mydomain.com/public/assets/templates/mytemplate/images/login.gif" alt="Login" width="103" height="23" border="0" /></a>
</div>
<div id="HeaderContainer_searchbox">
<form [+as.formId+] action="[+as.formAction+]" method="post">
<input type="hidden" name="advSearch" value="[+as.advSearch+]" />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right" class="search">Search:</td>
<td width="195" align="right"><input id="ajaxSearch_input" name="search" type="text" class="SearchBasicInputBox" value="[+as.inputValue+]"[+as.inputOptions+] /></td>
<td width="40" align="right"><input id="ajaxSearch_submit" type="image" name="sub" value="[+as.submitText+]" src="http://www.mydomain.com/public/assets/templates/mytemplate/images/btn_search.gif" alt="Go" /></td>
</tr>
</table>
</form>
</div>
</div>
`+]
[+as.showResults:is=`1`:then=`
[+as.results+]
`+]
Search box call is on top of the template page, (ie in the header (A) - see below)
[!AjaxSearch? &ajaxSearch=`0` &AS_landing=`30` &extract=`1`!]
Search Result Page has this call in the content body (Z) - see below.
[!AjaxSearch? &ajaxSearch=`0` &AS_showForm=`0`!]
Normal Page layout
***************************
Header (A) <--- search box is here
***************************
navigation menu (B)
***************************
Content Body (C)
***************************
Footer (D)
***************************
Search Result Page layout // page id = 30
***************************
Header (A) <--- search box is here
***************************
navigation menu (B)
***************************
Content Body (Z) <--- only want results to display here!
***************************
Footer (D)
***************************
The problem:
-Only would like the results to show on the result page via this call [!AjaxSearch? &ajaxSearch=`0` &AS_showForm=`0`!]
But what happens right now?,
User searchs, modx redirects user to search result page, results are shown twice on the results page!
at location A, and Z.
@A with this call [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`30` &extract=`1`!]
@Z with this call [!AjaxSearch? &ajaxSearch=`0` &AS_showForm=`0`!]
how can I make the results show on the result page only at location Z only?
Note: Search box is displayed on every page, i.e its in the template!