Good day! I have the search results web part on the wiki page. When I write some request in search field, I get some results. I open some result link to list element. I see the List DispForm.aspx with some filled fields. Then I click «Close» button on this form. I see the List default view. How can I return to search results after List element closing? I was searching for options in Web Part Properties, but I have no results. I would be grateful for any help.
-
I don't think there will be any OOTB way to do it. What you can do is modify your display template to open the DispForm.aspx page in the new tab.– Ankit KatiyarCommented Jul 26, 2018 at 7:52
-
Thanks for reply, but the site and subsites have a lot of lists, which have the elements to show in Search Results. The new users will create new lists. They will have the need to tell me about every new application. Maybe it's possible to change something else?– AnonymousCommented Jul 26, 2018 at 12:45
1 Answer
I found the solution. 1. Go to the Site Setting -> Master Page Gallery -> Display Templates/Search and locate the Item_Default.html file 2. Copy the Item_Default file and rename it to Item_Copy 3. Open the file in a text editor and find the title tag. Change the title to Back Item. 4. Update Table tag as follows
<table>
<tr>
<!-- <td class=”SearchDescription” rowspan=”2″>
_#=ctx.CurrentItem.DocumentUpdates=#_
</td>-->
</tr>
<tr>
<td class=”SearchBACK”>
<a href="_#=ctx.CurrentItem.Path=#_&Source=http://My Site/SitePages/MY_SEARCH_RESULTS_PAGE.aspx?k=dispform">
_#=ctx.CurrentItem.Title=#_
</a>
</td>
</tr>
</table>
- Save the file and copy it back to the Search Display Templates folder
- Return to Site Settings and choose Search Result Types from the Site Collection Administration section.
Locate the Default result type, hover click and choose Copy.
Change the name to Back and change the Action | What should these results look like? to Item_Copy.
Click Save
This topic was helpful for me https://social.technet.microsoft.com/Forums/office/en-US/8a26f055-74c4-4aed-89f4-7ed308cd6e5b/closing-an-item-from-search-results-takes-you-to-list-instead-of-back-to-search-results?forum=sharepointsearchlegacy
More Information about changing Search Results Template you can find here How sharepoint Search chose which fields to be shown inside the default display template for the list items