Multilingual search with AjaxSearch:
1. Create chunk AS_Result, where we need to change page title
from AjaxSearch type ( [+as.pagetitle+] )
to YAMS type ( [[YAMS? &get=`content` &from=`longtitle` &docid=`[+as.id+]`]] )
<div class="[+as.resultClass+]">
<a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[+as.longtitle+]">[[YAMS? &get=`content` &from=`longtitle` &docid=`[+as.id+]`]]</a>
[+as.descriptionShow:is=`1`:then=`
<span class="[+as.descriptionClass+]">[+as.description+]</span>
`+]
[+as.extractShow:is=`1`:then=`
<div class="[+as.extractClass+]"><p>[+as.extract+]</p></div>
`+]
[+as.breadcrumbsShow:is=`1`:then=`
<span class="[+as.breadcrumbsClass+]">[+as.breadcrumbs+]</span>
`+]
</div>
2. Create search form with search in specified TV’s according to chosen language. The landing page in this example is 50.
[!AjaxSearch? &ajaxSearch=`0` &AS_landing=`50` &AS_showResults=`0` &withTvs=`+:content_(yams_id),description_(yams_id),introtext_en,longtitle_(yams_id),menutitle_(yams_id),pagetitle_(yams_id)` &language=`(yams_mname)`!]
Nota bene! We have to use &ajaxSearch=`0` because there is incorrect page title displaying in ajax mode takes place. This is due to ajaxResult.tpl template in ajax mode is rendered bypassing YAMS.
3. Create landing page (in our example 50) within another AjaxSearch call:
[!AjaxSearch? &ajaxSearch=`0` &AS_showForm=`0` &AS_showResults=`1` &tplResult=`AS_Result` &language=`(yams_mname)`!]
4. Change redirection type in Modules → YAMS → Other Params → URL Redirection Settings → Redirection Mode to
“Current else Browser” for correct redirection to pages searched.
So it works now. This solution has limitations in ajax mode, and can produce some mistakes in search results, but enough correct for use.
With tanks to
PMS for help.