1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Custimizing the Search Box

Custimizing the Search Box

5 posts, 0 answered
  1. Blake
    Blake avatar
    10 posts
    Registered:
    28 Jul 2009
    28 Jul 2009
    Link to this post

    Hi Sifefinity Folks,

    I am working on a Sitefinity project and have creating a master page/template.  On this template, I have added a Search Box control (via admin).  I noticed that the control uses a control template to produce the desired output.  I need to change this output but did not know if I could update the \Sitefinity\ControlTemplates\Search\SearchBox.ascx file to accomplish what I wanted.

    What is the best practice here?  Should I create a ControlTemplates folder elsewhere or just update the file here?

    Thanks!

    Blake

  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    28 Jul 2009
    Link to this post
    Hello Blake,

    You can update the file there. Just be careful not to override your updated version of the file with the next Sitefinity upgrade.

    Sincerely yours,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  3. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    28 Jul 2009
    Link to this post
    While you are certainly able to edit the template in its default location, i would suggest as a 'best practice' that you assign it to an external template in the same location as any other external templates you are using. You never know if you might forget that you changed it, and when you upgrade as Georgi mentioned, your template will be overwritten.

    even if you aren't prone to forgetting someone else may someday upgrade it and not realize changes were made.

    you can set the control template in the properties of the control by clicking edit. Alternativelly, as I did on our sites, you can embed the control directly on the master page:

    <%@ Register tagprefix="cc" namespace="Telerik.Search.WebControls" assembly="Telerik.Search" %> 
     
    <cc:SearchBox ID="SearchBox1" runat="server" IndexCatalogue="MySearch" 
         ResultUrl
    ="~/Search.aspx" LayoutTemplatePath="~/Templates/Public/Search/SearchBox.ascx" /> 

    this way all your templates are always in one separate place, and don't get overwritten.

    hope this was helpful!
  4. Blake
    Blake avatar
    10 posts
    Registered:
    28 Jul 2009
    06 Aug 2009
    Link to this post
    Hey Guys,

    Thanks for the help.  Good ideas.

    Blake
  5. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    06 Aug 2009
    Link to this post
    Hello Josh,

    We thank you too for taking part in the discussion.

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
Register for webinar
5 posts, 0 answered