Working solution with ajax mode of AjaxSearch (with a lot of dirty patches):
1. put yams to redirect "current" mode.
2. change assets/snippets/ajaxSearch/configs/default.config.php and add $dcfg[’tvPhx’] = ’tv:displayTV’;
In general, don’t relay on configuration in the snippet together with YAMS (I will explain later why)
3. use snippets like this per language and put them in chunks:
- bulgarian chunk "ajaxSearch_bg"
[!AjaxSearch? &tvPhx=`tv:displayTV` &withTvs=`+:content_bg,description_bg,introtext_bg,longtitle_bg,menutitle_bg,pagetitle_bg` &language=`bulgarian` &tplAjaxResult=`ajaxResult_bg.tpl` &tplResult=`result_bg.tpl`!]
- bulgarian template ajaxResult_bg.tpl
<div class="[+as.resultClass+]">
<a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[+as.pagetitle_bg+]">[+as.pagetitle_bg+]</a>
[+as.descriptionShow:is=`1`:then=`
<span class="[+as.descriptionClass+]">[+as.description_bg+]</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>
Do the same for other languages
4. call the chunks with:
[[YAMS &get......]]
------------------------
Now you should have working solution but only for one of the languages. I don’t know for which one, but the reason is folowing:
Open the source code of one of your pages, which have the search.
In the head section you will see something like:
<!-- start AjaxSearch header -->
<script type="text/javascript">
//<![CDATA[
as_version = '1.8.4';
advSearch = 'oneword';
subSearch = 5;
ucfg = ' &withTvs=`+:content_en,description_en,introtext_en,longtitle_en,menutitle_en,pagetitle_en` &tplResult=`result_en.tpl` &tplAjaxResult=`ajaxResult_en.tpl`';
//]]>
</script>
<!-- end AjaxSearch header -->
<!-- start AjaxSearch header -->
<script type="text/javascript">
//<![CDATA[
as_version = '1.8.4';
advSearch = 'oneword';
subSearch = 5;
ucfg = ' &language=`bulgarian` &withTvs=`+:content_bg,description_bg,introtext_bg,longtitle_bg,menutitle_bg,pagetitle_bg` &tplResult=`result_bg.tpl` &tplAjaxResult=`ajaxResult_bg.tpl`';
//]]>
</script>
<!-- end AjaxSearch header -->
As you can see you have 2 AjaxSearch initializations
(@PMS - this is related to my other post for execution of snippets for all languages, independent on the current)
This leads to the fact that only the last initialized configuration will work. And it is always the same order, independent on the current language.
5. To fix this, copy the initialization content per language and put it in separate chunks:
ajaxInit_bg
<!-- start AjaxSearch header -->
<script type="text/javascript">
//<![CDATA[
as_version = '1.8.4';
advSearch = 'oneword';
subSearch = 5;
ucfg = ' &language=`bulgarian` &withTvs=`+:content_bg,description_bg,introtext_bg,longtitle_bg,menutitle_bg,pagetitle_bg` &tplResult=`result_bg.tpl` &tplAjaxResult=`ajaxResult_bg.tpl`';
//]]>
</script>
<!-- end AjaxSearch header -->
do similar chunks for other languages
6. Call these chunks with [[YAMS? &get......]] just before you call the real AjaxSearch chunks (or include the above code in the real chunk)
See the solution in action at
http://bbr.nitbg.com
If this link is not available (which will be the case in few days) the production site will be
http://www.bbr.bg