Hi,
I'm trying to modify one of our existing search pages to display the nested results of a secondary search page which looks for images (a bit like a Google results page I suppose, where it shows a few images based on your current search, and then you can choose to go and look at more image results). Ideally there'd be, say, 20 results per page for the standard search, but only the first 5 or 10 image results would show with a link to more.
There are a few reasons we want it to work this way, as opposed to just adding images as an asset type to the existing search:
- The existing search is restricted to the one site, but we want to pull images from multiple sites.
- There will be potentially thousands of image results for some terms so we don't want them interspersed with the standard page results.
- We don't want to force people to wait for the results of a combined page and image search if they're just after pages.
So the existing search is just an ordinary Matrix search page set up to look for standard pages within one site (this is the current, live search page: http://classroom.antarctica.gov.au/search).
Within the results page layout of this Search page, I've now nested the secondary image search page (it's under construction, so you can't see it, sorry).
The image search page is set up to do stored searches, using a GET variable which is query.
In the nested content properties (see image), I've added a variable called query, to match the stored search. When I use a fixed term (such as penguins, as you can see in the image), it works beautifully, nesting the 'penguins' image results within the results page of the main search.
[attachment=700:image-search.gif]
However, what I need to do is somehow pass the term the user has entered on the main search page into the image search. So if they visit the search page linked above and type in emperor penguin, I want that term to be fed through to the nested content query variable so that it's used by the image search as well.
Therefore I've tried, without any success, putting the search term keyword normally used on the results page (in this case it's %keywords_query_terms%) into the Variable Value field in the nested content's properties (where I currently have 'penguins').
I've tried:
- %keyword_query_terms%
- %list_current_keyword_query_terms%
- %nested_keyword_query_terms%
- %globals_keyword_query_terms%
None of these work. The first three just cause a search for the actual keyword (i.e. 'keyword_query_terms'). The 'globals' one brings back a blank (which implies that it's at least being resolved, but it's somehow losing its value before it gets passed).
If I change 'Disable keyword replacements' on the Image search's details screen to 'No' then they all come back blank.
Am I missing something or is this destined to fail? I'm open to other suggestions of ways to make this work.
Thanks! image-search.gif (20 KB)