Search Widget in master page
Hi,
I am trying to add a search bar in the master page. So, I have these two lines in my master page
<%@ Register Assembly="Telerik.Sitefinity.Search.Impl" Namespace="Telerik.Sitefinity.Services.Search.Web.UI.Public" TagPrefix="sfSearch" %>
<sfSearch:SearchBox ID="searchBox1" runat="server"></sfSearch:SearchBox>
Normally, when we add the searchbox from the backend, when you click edit, we can specify the index to be used and the target results page. But when you add the search bar in master page, how can we specify these two properties? The search results page is a backend page which url looks like ~/searchresults.
Hi Prashant,
I would guess you can include the properties you would normally set in the backend in your markup as well, but you would probably have to set these to the GUIDs of the desired page, search index, etc. I did it by creating a page template based on the master page and dragging the widget onto it to set the properties in the normal way there.
Arno,
Thanks for your comment. Here is what I have done
<%@ Register Assembly="Telerik.Sitefinity.Search.Impl" Namespace="Telerik.Sitefinity.Services.Search.Web.UI.Public" TagPrefix="sfSearch" %>
sfSearch:SearchBox ID="searchBox1" SearchIndexPipeId="Guid Goes here" ResultsUrl="~/SearchResults" IndexCatalogue="Test" runat="server"></sfSearch:SearchBox>
I initially had just resultsurl and Indexcatalogue properties. It started working only after I grabbed the guid from sf_publishing_pipe_settings table for the index I created in the backend.
Hi Prashant,
Glad to hear that you managed to get it working - basically there are several properties which you need to set to the search control:
SearchIndexPipeId
ResultsUrl
After configuring them properly you should be able to take advantage of the search index.
Regards,
Victor Velev
the Telerik team