<![CDATA[ [SOLVED with limitations] YAMS and AjaxSearch - My Forums]]> https://forums.modx.com/thread/?thread=45462 <![CDATA[Re: [SOLVED with limitations] YAMS and AjaxSearch]]> https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=4#dis-post-539846 4. Change redirection type in Modules → YAMS → Other Params → URL Redirection Settings → Redirection Mode to “Current else Browser” for correct redirection to pages searched.
This helped me with eForm redirect to the right language (&gotoid=`22`)]]>
fourroses666 Mar 22, 2016, 06:44 AM https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=4#dis-post-539846
<![CDATA[Re: [SOLVED with limitations] YAMS and AjaxSearch]]> https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=4#dis-post-263088
As a note, when I use &asId in the landing page calls, I get a blank response from AjaxSearch. This is all live btw, so you can check:

English: http://www.primaloft.com/en/performance/home.html
Japanese: http://www.primaloft.com/jp/performance/home.html

(I’ve been using ’hunting’ as a test search query)

Any guidance would be appreciated.

Call:
 [!AjaxSearch? &asId=`(yams_id)` &ajaxSearch=`0` &landingPage=`56` &showResults=`0` &highlightResult=`0` &tplInput=`search-form_(yams_id)` &withTvs=`+:content_(yams_id),description_(yams_id),introtext_(yams_id),longtitle_(yams_id),menutitle_(yams_id),pagetitle_(yams_id)` &language=`(yams_mname)`!]


Landing page call:
[!AjaxSearch? &ajaxSearch=`0` &showInputForm=`0` &showResults=`1` &tplResult=`search-result` &language=`(yams_mname)` &highlightResult=`0`!]


search-result chunk
<div class="[+as.resultClass+]">
<a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[[YAMS? &get=`data` &from=`longtitle` &docid=`[+as.id+]`]]">[[YAMS? &get=`data` &from=`longtitle` &docid=`[+as.id+]`]]</a>
[+as.descriptionShow:is=`1`:then=`
  <span class="[+as.descriptionClass+]">[[YAMS? &get=`data` &from=`description` &docid=`[+as.id+]`]]</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>


I hope I’m doing something stupid that will be easy to fix smiley]]>
althenry Feb 11, 2011, 12:07 PM https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=4#dis-post-263088
<![CDATA[Re: [SOLVED with limitations] YAMS and AjaxSearch]]> https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=4#dis-post-263087
Here is the code:

[!AjaxSearch? &ajaxSearch=`0` &clearDefault=`1` &tplResult=`AS_Result` &asLog=`2:0:1000` &tvPhx=`tv:displayTV` &language=`(yams_mname)` &withTvs=`+:content_(yams_id) ,description_(yams_id), introtext_(yams_id), longtitle_(yams_id), menutitle_(yams_id),pagetitle_(yams_id)` &whereSearch=`content:NULL`!]


Tested with modx 1.0.4 and Ajaxsearch 1.9.0]]>
kittyhawk Jan 25, 2011, 03:39 AM https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=4#dis-post-263087
<![CDATA[Re: [SOLVED with limitations] YAMS and AjaxSearch]]> https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=4#dis-post-263086
Regarding the extracts: I *think* that the way your AjaxSearch call is currently set up it will search within the standard document variables and the template variables of the current language. So perhaps it is sometimes matching on content in a standard document variable (which is in one language) and sometimes matching on a template variable (which could be in another)? Perhaps you could prevent AjaxSearch from searching within standard document variables by using something like: [tt]&whereSearch=`tv`[/tt]. I don’t fully understand the syntax of the [tt]&extract[/tt] parameter. From the wiki documentation it looks like [tt]&extract=`1:tv_content`[/tt] is what you need rather than [tt]&extract=`1:tv_value`[/tt]?

I think that [tt][+as.description+][/tt] will output the contents of the document variable description field. You probably want to use [tt][[YAMS? &get=`data` &from=`description` &docid=`[+as.id+]`]][/tt] instead. (I’d use [tt]&get=`data`[/tt] rather than [tt]&get=`content`[/tt], because in the next version of YAMS [tt]content[/tt] will be phased out and [tt]data[/tt] will function correctly for monolingual documents as well as multilingual documents.)

I don’t think it will be possible to implement a fallback language for the extract since I can’t think of a way to overcome the fact that AjaxSearch supplies only one extract from one field.]]>
PaulSuckling Jun 30, 2010, 06:57 PM https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=4#dis-post-263086
<![CDATA[Re: [SOLVED with limitations] YAMS and AjaxSearch]]> https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=4#dis-post-263085
This is the snippet call on my landing page:

[!AjaxSearch? &ajaxSearch=`0` &parents=`in:2,11` &showInputForm=`0` &showResults=`1` &tplResult=`tplResult` &pagingType=`0` &tplResults=`tplResults` &tplGrpResult=`tplGrpResult` &language=`(yams_mname)` &grabMax=`10` &extract=`1:tv_value` &withTvs=`+:content_(yams_id),description_(yams_id),introtext_(yams_id),longtitle_(yams_id),menutitle_(yams_id),pagetitle_(yams_id)`!]


The tplResult looks like
<div class="[+as.resultClass+]">
<a class="[+as.resultLinkClass+]" href="(yams_doc:[+as.id+])" title="[+as.longtitle+]">[[YAMS? &get=`content` &from=`pagetitle` &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=`
  <div class="[+as.breadcrumbsClass+]">[+as.breadcrumbs+]</div>
`+]
</div>


This should be the code proposed by Fil DOrc in the original post.

I get the following result (using a bi-lingual website in english and german):

The page titles of the found pages are output in the correct language. But the extracts are in random language. I can see no pattern for it. I just had a idea, but it is not correct: The website is still being filled with content, and there are many pages with german content but no english content yet. My idea was that there would always be shown the correct language (testing mainly with german) but if it is not available, the extract would fall back to the other language. But this is not true. And now as I am typing I am wondering how the mono-lingual AjaxSearch could have a buil-it fall-back ...

Does anybody have any idea?]]>
FuryDE Jun 29, 2010, 10:43 AM https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=4#dis-post-263085
<![CDATA[Re: [SOLVED with limitations] YAMS and AjaxSearch]]> https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=4#dis-post-263084 ]]> FuryDE Feb 10, 2010, 07:27 AM https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=4#dis-post-263084 <![CDATA[Re: [SOLVED with limitations] YAMS and AjaxSearch]]> https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=3#dis-post-263083 PaulSuckling Feb 10, 2010, 06:59 AM https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=3#dis-post-263083 <![CDATA[Re: [SOLVED with limitations] YAMS and AjaxSearch]]> https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=3#dis-post-263082
If I replace the [tt][+as.resultLink+][/tt] by for example "linkurl" in the result template, then it works fine (up to the links, wich are obvously incorrect.

As soon as I use [tt][+as.resultLink+][/tt] again, I get the empty landing page.]]>
FuryDE Feb 10, 2010, 06:12 AM https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=3#dis-post-263082
<![CDATA[Re: [SOLVED with limitations] YAMS and AjaxSearch]]> https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=3#dis-post-263081
I’m trying to use YAMS and AjaxSearch together, without actually using Ajax. I have followed the steps from the original post in this thread. But, when I enter my search phrase and hit "enter", i get a blank page (HTML Validator says "End of document in prolog").

If I change the name of my [tt]AS_Results[/tt]-chunk to a different name (leaving the AS-call on the landing page unchanged), so that the results page won’t find the chunk, then I get shown the correct number of pages (all well included in my resource template) where my search phrase was found.

Any idea what’s going wrong here?

Thanks
Martin]]>
FuryDE Jan 28, 2010, 08:11 AM https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=3#dis-post-263081
<![CDATA[Re: [SOLVED with limitations] YAMS and AjaxSearch]]> https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=3#dis-post-263080 PaulSuckling Jan 24, 2010, 03:30 PM https://forums.modx.com/thread/45462/solved-with-limitations-yams-and-ajaxsearch?page=3#dis-post-263080