Close button on Search Results Item return to search page, not list.

You’ve created an intranet page that searches a specific list.  You have created a custom display template where an end user clicks on the title to see more details.  The default “Close” button (<SharePoint:GoBackButton runat=”server: ControlMode=”Display” ID=”gobackbutton2″/>), if clicked, returns the user to the entire list.  You would prefer the user be returned to the intranet search page, not the list.

To do this…

  1. Open the display template in Notepad++ or SharePoint Designer
  2. Delete the default SharePoint close button and add you own with html code setting the location.href property to the search page.

For example; <input type=”button” value=”close” onclick=”location.href=’http://www.yoursitenamehere.com'”/&gt;

 

Advertisements

SharePoint 2013 Crawled property names

The names of SharePoint crawled properties are not always easily read or understood.  Here are few tips that helped me out a lot once I learned them:

  • ​List Columns = ows_ColumnName
  • Site Columns = ows_q_<4 letter code that maps to the data type>_Column Name
  • Managed Metadata = ows_taxId_ColumnName
  • HTML or Multiline Text = ows_r_<4 letter code that maps to the data type>_Column Name

 

SharePoint 2013 Search Results Query Not Working

Problem: You add a Search Results webpart to a page and using the query builder configure the results to retrieve and the format in which to sort or filter them.  In the preview on the query builder the query appears to be returning the correct results, in the sorted format desired, but when you save and close the page the results are not sorting.

Solution: Create a Result Source on the site collection that has the same query.  Then go to the page with the Search Results webpart and in the query builder choose the newly created Result Source where you “Select a query”.  Save and close the page and the query should now return the expected results in the sorting format desired.