Hi Markieham,
1/
The website we’re running has a template variable filled with the names of the contact person for that specific page. This is shown on the page itself to the right. When using the search, eg searching for ’frans’, one of the contacts, it returns 19 results. Strange thing here: the name only shows up in the content field on one page.
Keep in mind that all the TV are concatened to setup a tv_value. This is why you got several results when you search "frans". As "frans" is concatened with the others TV values, you retrieve it in some others search results.
If you would like run a search only with this tv adds &withTVs=`contactpersonen`
---- &withTvs (optional)
Define which Tvs are used for the search in Tvs
a comma separated list of TV names
by default all TVs are used (empty list)
To understand what I mean, add &debug=`1` as parameter, do a search, open the assets/snippets/ajaxSearch/ajaxSearch_log.txt file and search "SQL". Copy/paste the entire SQL statement logged in the file into the SQL statement window of your phpMyAdmin tool, execute the sql statement and look at the results. Notice the content of the tv_value content field.
2/
Now that isn’t too bad, but when it finds the name in the TV, it seems to refuse to display an extract of the page.
To display the Tv content use the tvPhx parameter as follow: &tvPhx=`tv:displayTV` and then in your result chunk use [+as.contactpersonenShow+], [+as.contactpersonenClass+], [+as.contactpersonen+] placeholders to show the informations required. See below as example:
<div class="[+as.resultClass+]">
<a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[+as.longtitle+]">[+as.pagetitle+]</a>
[+as.descriptionShow:is=`1`:then=`
<span class="[+as.descriptionClass+]">[+as.description+]</span>
`+]
[+as.contactpersonenShow:is=`1`:then=`<div class="[+as.contactpersonenClass+]"><p>[+as.contactpersonen+]</p></div>`+]
<div class="[+as.extractClass+]"><p>[+as.extract+]</p></div>
<span class="[+as.breadcrumbsClass+]">[+as.breadcrumbs+]</span>
</div>
Here is the extract of the readme file, regarding TV:
&tvPhx : Set placeHolders for TV (template variables)
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!
Your AS snippet call should look like something this:
[!AjaxSearch? &ajaxSearch=`0` &AS_landing=`7` &depth=`3` &whereSearch=`content:content|tv` &withTVs=`contactpersonen` &language=`nederlands`!]
- &AS_showResults=`0` is useless (the results should be displayed on the landing page)
- Replace &whereSearch=`content:content|tv:NULL` by &whereSearch=`content:content|tv`. You need the tv

- &extractLength=`400` is a parameter for the display. Not relevant for the search and for the display of the input form. Use it on the landing page.
- Custom templates like result and results are not used to run the search too.
And on the landing page (where the results are displayed):
[!AjaxSearch? &ajaxSearch=`0` &showInputForm=`0` &formatDate=`d-m-Y` &depth=`3` &withTVs=`contactpersonen` &tvPhx=`tv:displayTV` &extractLength=`400` &whereSearch=`content:content|tv` &tplResults=`zoek-results` &tplResult=`zoek-result` &language=`nederlands`!]
Why do you change the id of the input form ? You can also style the input form by using #ajaxSearch_form, #ajaxSearch_input, #ajaxSearch_submit and #ajaxSearch_output styles.
You can get more information on the "
Display TV’s with tvPhx" demo page.
Hope that this help you.