Recently I was given a task to enable Search Bar in Search result page of SharePoint. If you meet such requirement here is the simple solution:
Case 1: You have not configured search service:
In this case your search will open SharePoint default result page: osssearchresults.aspx.
You can find this page in "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS".
Open this page and in "PlaceHolderSearchArea" ContentPlaceHolder add below lines of code:
<div id="searchInputBox">
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" />
</div>
save the file.
Refresh your search page and you will see the search bar in header section.
Case 2: You have configured Search service:
In this case your search will open pages/result.aspx page for search result.
But we can't add our code in this page. We need to add our block of code in the page layout of this page.
You can find that in "Site settings->masterpages & page layouts -> SearchResult.aspx"
Download this page.
Open this page and in "PlaceHolderSearchArea" ContentPlaceHolder add below lines of code:
<div id="searchInputBox">
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" />
</div>
save the file.
If you refresh your page and you get error "Sorry, Something went wrong", Please check this blog.
Subscribe to:
Post Comments (Atom)
-
Issue : Recently, we had a requirement to sync the calendar between shared mailbox outlook and SharePoint Calendar list. We have created 2 f...
-
Issue : Recently there was an issue we face while training React. Generally we give training using video series on YouTube but this time we ...
-
Issue: Recently, we were developing a SPFx webpart in which we needed to open a dialog. For that we decide to use Office Fabric UI Dialog co...
No comments:
Post a Comment