Hi,
I had built a test site a year or so ago and have recently been asked by a client to continue with it.
It’s built on MODX version 1.0.2
We use TVEXPLORER / TVEDITOR to filter results and display them in a CHUNK which works perfectly. The Search Form does a
<form action="[~15~]" method="post">
, ID 15 being the Landing Page for the results. On this Landing Page there is a large image that originally was static and did not change however the client asked if this image could change every time the search was run.
Now we have a folder on the server holding 6 images that rotate on the Landing Page using a little bit of php in a file called rotate.php which simply changes the image every time the page is refreshed or the search is run. Again, this working great!
Now the client has asked if the images can match the Search results. For example, if a user searches for “Personal Finance” then the results page would have a relevant image. If a user searches for “Health and Beauty” then the results page again displays a relevant image to Health and Beauty.
I know that it’s simple to specify an image in a template or even to rotate images in the template but does anyone know how to display images relevant to search results?
The following is placed on the landing page.
[!tvExplorer? &dittoName=`Ditto` &dittoSnippetParameters=`tpl:dittoResultsChunk|parents:2|depth:1|display:all|sortBy:pagetitle|sortDir:ASC|showPublishedOnly:1` &formTPL=`divSearchChunk` !] [+tve.dittoList+]
Thanks in advance for your help.