E
E
ecostmn2017-05-30 13:06:44
MODX
ecostmn, 2017-05-30 13:06:44

How to set up site search correctly?

Through the snippet AjaxSearch, filtering by projects was performed, we decided to implement an additional search through the site through a line with the results displayed on a separate page.
The search works correctly, but the filtering by projects stopped working The
question is how to fix it correctly so that the filtering works correctly. At the moment, it gives the following answer: "Search results for the site
You need at least 3 characters in the search query"
Please help. I will be very grateful.
Search by projects
Filter projects
By cost
< form name="search" action="resultaty-poiska" method="post"> < p style="margin-top:10px;">from < input class="" type="text" name="min_price" id="min_price" value="123"> to < input class="" type="text" name="max_price" id="max_price" value="">
By area

< div id="slider2"></div><p style="margin:10px 0;">от < input class="" type="text" name="min_s" id="min_s" > до < input class="" type="text" name="max_s" id="max_s" ></p>  < button class="but" type="submit" >Подобрать</button>   < /form>

Displaying results of pages with id=120
[!Ditto?  &tpl=`miniCard` &extenders=`request` &parents=`0` &depth=`5`&filter=`` &diplsay=`all` &orderBy=`min_price ASC`!])

The search itself in the call header
[!AjaxSearch? &ajaxSearch=`0` &tpl=`Search_form` &showIntro=`0` &showResults=`0`&landingPage=`135` !]

with output of results with id=135
[!AjaxSearch? &ajaxSearch=`0`&showInputForm=`0`&pagingType=`0`!])

input.tpl with code like this
/assets/snippets/ajaxSearch/templates/input.tpl.html
[+as.showInputForm:is=`1`:then=`
<form  name="search" action="[~135~]" method="post" >
    [+as.showAsId:is=`1`:then=`<input type="hidden" name="[+as.asName+]" value="[+as.asId+]" />`+]
    <input type="hidden" name="advsearch" value="[+as.advSearch+]" />
    <input id="ajaxSearch_input" class="header__search form input[type="text"]" type="text" name="search" value="[+as.inputValue+]"[+as.inputOptions+] />
    [+as.liveSearch:is=`0`:then=`
        <input id="ajaxSearch_submit" class="header__search form input[type="submit"]" type="submit" name="sub" value="[+as.submitText+]" />
    `+]

`+]

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question