More in this section
Forums / General Discussions / Out of the Box Search Box Empty Text

Out of the Box Search Box Empty Text

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
3 posts, 0 answered
  1. James
    James avatar
    0 posts
    27 Oct 2015
    07 Mar 2017
    Link to this post
    I would like to add something like "Enter Search Term Here" for the search box text when the page loads, much like the EmptyMessage feature of radtextbox.  Is there a way to easily do this with the out of the box search control? 
  2. Victor Leontyev
    Victor Leontyev avatar
    65 posts
    01 Jul 2014
    08 Mar 2017 in reply to James
    Link to this post

    Hi James,

    For Search Box MVC widget, sitefinity has BackgroundHint setting (SearchBoxBackgroundHint image).  For old widget, SF doesnt have this setting, you can do that by modifying template of search box. You can do that on this way:

    1) Save this code as SearchBox.ascx

    <%@ Control Language="C#" %>
    <%@ Register TagPrefix="sitefinity" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" %>
    <sitefinity:ResourceLinks id="resourcesLinks" runat="server" UseEmbeddedThemes="True" UseBackendTheme="True">
        <sitefinity:ResourceFile JavaScriptLibrary="JQuery" />
        <sitefinity:ResourceFile JavaScriptLibrary="KendoAll" />
    <%--    <sitefinity:ResourceFile Name="Telerik.Sitefinity.Resources.Scripts.Kendo.styles.kendo_common_min.css" Static="true" />
        <sitefinity:ResourceFile Name="Telerik.Sitefinity.Resources.Scripts.Kendo.styles.kendo_default_min.css" Static="true" />
        <sitefinity:ResourceFile Name="Telerik.Sitefinity.Resources.Scripts.Kendo.styles.kendo_mobile_all_min.css" Static="true" />--%>
    <fieldset id="main" class="sfsearchBox" runat="server">
        <asp:TextBox ID="searchTextBox" runat="server" CssClass="sfsearchTxt" />
        <asp:Button  id="searchButton" runat="server" Text="<%$Resources:SearchResources, Search %>" OnClientClick="return false;" CssClass="sfsearchSubmit" />

    2) Place it inside of your project

    3) Edit this template and put any placeholder

    4) Go to widget settings of "Search Box" widget and change LayoutTemplatePath to the new path

  3. WebGeek
    WebGeek avatar
    186 posts
    20 Dec 2006
    08 Mar 2017 in reply to Victor Leontyev
    Link to this post
    Thank You!  The MVC was the key and it looks great.  
3 posts, 0 answered