Can I return 'You searched for:######' at the top of search results?

Jon White asked on January 29, 2015 11:25

Hi there,

Is it possible to create a transformation that can gather the search term to show what you searched for?

i.e. "You searched for 'Lorem Ipsum', it returned 13 results."

Perhaps this is out-of-the-box and I just haven't seen it, but otherwise is this possible to use a macro or something?

Thank you in advance Jon

Recent Answers


Juraj Ondrus answered on January 29, 2015 12:38

Hi,

The search term should be in the URL query string - so you can use e.g. a query string macro in an editable region or in the content before property of given web part. However, be sure the macro is safe and no SQLi vulnerability is possible (more on SQLi). Or, another option is to create custom transformation function that will simply read the query string value - again be careful - SQLi.

2 votesVote for this answer Mark as a Correct answer

Roman Hutnyk answered on January 29, 2015 20:52

Try {%searchtext%}

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.