[!AjaxSearch? &ajaxSearch=`0` &AS_landing=`13` &AS_showResults=`0` &tplLayout =`searchBox` &tvPhx=`tv:displayTV` &whereSearch=`content|tv:Product_Name` !]
[!AjaxSearch? &ajaxSearch=`0` &AS_landing=`0` &tplResult=`searchResults`!]
<div id="searchResults" class="searchResults"> [*as.pagetitle*] Product Name: <h4><a href=[~[+as.id+]~] title="Find out more about [+as.Product_Name+]">[+as.Product_Name+]</a></h4> Product Description: <p>[+as.Product_Description+]</p> Product Thumb: <a href=[~[+as.id+]~] title="[+as.Product_Name+]"><img src="[+as.Product_Photo_Thumb+]" border="0" alt="Find out more about [+as.Product_Name+]" title="Find out more about [+as.Product_Name+]"/></a> Find out more link: <p><a href=[~[+as.id+]~] title="Find out more about [+as.Product_Name+]">Find out more about [+as.Product_Name+]</a></p> <hr /> </div>
[!AjaxSearch? &ajaxSearch=`0` &AS_landing=`13` &AS_showResults=`0` &withTV=`Product_name` &tplLayout =`searchBox`!]
[!AjaxSearch? &ajaxSearch=`0` &withTvs=`Product_name` &tvPhx=`tv:displayTV` &tplResult=`searchResults`!]
What would the calls be in the Chunk then? Would they remain as i have them already?Yes.
&tvPhx : Set placeHolders for TV (template variables)So you could use:
* 0 : disallow the feature
* ’tv:displayTV’ : set up placeholders for each TV (named tvName) linked to the documents found (default)
Placeholders for TVs are:
* [+as.tvName+], [+as.tvNameShow+], [+as.tvNameClass+]
Where tvName is the MODx name of a TV
* [+as.tvName+] is the HTML output of your TV
* [+as.tvNameShow+] = 1 if the TV is not NULL
* [+as.tvNameClass+] :
- ajaxSearch_resultTvName for the non ajax results (&tplResult)
- AS_ajax_resultTvName for the ajax window (&tplAjaxResult)
e.g: AS_ajax_resultAsTag1, a tv named "asTag1" (take care, the first letter of tvName should be here an upper case) displayTV is a provided ajaxSearch function which render the Modx TV output. Don’t change the name!
It appears that template variables only show up if they match the searched term. Is there a way to pull in all template variables when a document is matched?Not without hacking the code. The next release will display all tvs when a document is matched, even if the tv don’t match.
Also, the results seem to be heavily weighted on the content. I have some documents where all the template variables match, but no content matches (so 2-3 matches in the template variables), but those get outranked by one match in the content. Seems to me like the multiple template variable matches would rank higher.Ok, I will try to check this point, but as I have strongly redesigned the snippet, I will prefer do the tests on the next release (1.9 currently in development).