Search Widget in master page

Posted by Community Admin on 04-Aug-2018 20:43

Search Widget in master page

All Replies

Posted by Community Admin on 21-Jan-2013 00:00

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. 

Posted by Community Admin on 22-Jan-2013 00:00

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.

Posted by Community Admin on 22-Jan-2013 00:00

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. 


Posted by Community Admin on 24-Jan-2013 00:00

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

This thread is closed