I want to create a link to the search results page with the current SiteTitle in the URL. For example:


What is the SP Designer markup? For example:

<a href="~sitecollection/SearchResults.aspx#k=<!--SPM<thisSiteTitle/>-->">Link to Search Results</a>

You can use JavaScript:

<a onclick="javascript: location.href = _spPageContextInfo.siteAbsoluteUrl + '/SearchResults.aspx?k=' + _spPageContextInfo.webTitle">Link to Search Results</a>
| improve this answer | |
  • Thanks! This works, but I was looking for a non-JavaScript way of doing it. Either in ASP or XML. – MrRCG Sep 19 '14 at 21:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.