MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

How to disable options from search ?  (Mono Support )

Viewed 4696 time(s), 14 post(s) 1/11/2013 8:43:07 PMby super
super

super

1/11/2013 8:43:07 PM
When any user click on search textbox, the drop down hover gives options with checkboxes like : search in FORUMS, BLOG, CALENDER etc ?

I want to remove a few options like calender, events etc - how to do that ?
This content has not been rated yet. 
6018 Reputation 709 Total posts
khorvat

khorvat

1/12/2013 8:39:40 AM
Ho, you can turn off search providers manually in markup or dynamically in web part properties. Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
super

super

1/12/2013 1:49:08 PM
where i should look ? please provide location ?
This content has not been rated yet. 
6018 Reputation 709 Total posts
mzilic

mzilic

1/14/2013 11:21:48 AM
Hello,

MonoXSearchBox and MonoXSearchBoxWithFilter controls have a property called SearchProviders which you can use to set your desired providers.

Regards,
Mario
This content has not been rated yet. 
2218 Reputation 300 Total posts
super

super

1/14/2013 9:42:44 PM
Since I only have ascx file that give me this code - How am I supported to look for property called "SearchProviders" ?

All I see is the following :? what to do and where ?

<%@ Control
    Language="C#"
    AutoEventWireup="true"
    CodeBehind="MonoXSearchBoxWithFilter.ascx.cs"
    Inherits="MonoSoftware.MonoX.ModuleGallery.MonoXSearchBoxWithFilter" %>
 
<%@ Import Namespace="MonoSoftware.MonoX.Resources" %>
 
<asp:ScriptManagerProxy ID="scriptManagerProxy" runat="server"></asp:ScriptManagerProxy>
<asp:panel ID="pnlContainer" runat="server" DefaultButton="btnSearch" CssClass="search-filter-container">
    <div class="search">
        <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" /><MonoX:StyledButton runat="server" ID="lnkSearch" OnClick="btnSearch_Click" CssClass="search-styled-button"></MonoX:StyledButton>
        <div class="holder">
            <asp:TextBox AutoCompleteType="Disabled" runat="server" ID="txtSearch"></asp:TextBox>
        </div>
        <dl class="search-filter-list" style="display: none;">
            <strong><%= MonoSoftware.MonoX.Resources.Search.SearchFilterCaption %></strong>
            <asp:Repeater ID="rptFilters" runat="server">
                <ItemTemplate>
                    <dd>
                        <input type="checkbox" runat="server" value='<%# Eval("ProviderName") %>' checked='<%# Eval("CheckedValue") %>' />
                        <label for='<%# Eval("ProviderLocalization") %>'><%# Eval("ProviderLocalization") %></label>
                    </dd>
                </ItemTemplate>
            </asp:Repeater>
        </dl>
    </div>
</asp:panel>
This content has not been rated yet. 
6018 Reputation 709 Total posts
mzilic

mzilic

1/14/2013 10:07:22 PM
Hello,

There are various ways you could accomplish this, I need to know how you setup your project. Did you follow this article to setup your project?

Regards
This content has not been rated yet. 
2218 Reputation 300 Total posts
super

super

1/14/2013 11:06:10 PM
At present, I have the latest nightly build that I downloaded and I opened it as a website in Visual Studio...that's all I did...
This content has not been rated yet. 
6018 Reputation 709 Total posts
khorvat

khorvat

1/15/2013 9:36:54 AM
Hi,

I think you should modify the search provider list in the page/control that instantiate the search control e.g. SearchResults:

<portal:PortalWebPartZoneTableless HeaderText='<%$ Code: PageResources.Zone_RightPartZone %>' ID="rightPartZone" runat="server" Width="100%" ChromeTemplateFile="Standard.htm" ShowChromeForNonAdmins="false">
                    <ZoneTemplate>
                        <MonoX:Search ID="search1" runat="server" Title='<%$ Code: PageResources.Title_SearchResults %>'>
                            <SearchProviderItems>
                                <Search:SearchProviderItem Name="PagesSearchProvider" Template="Default"></Search:SearchProviderItem>
                                <Search:SearchProviderItem Name="BlogSearchProvider" Template="Default"></Search:SearchProviderItem>
                                <Search:SearchProviderItem Name="DiscussionSearchProvider" Template="Default"></Search:SearchProviderItem>
                                <Search:SearchProviderItem Name="NewsSearchProvider" Template="Default"></Search:SearchProviderItem>
                                <Search:SearchProviderItem Name="UserProfileSearchProvider" Template="Default"></Search:SearchProviderItem>
                                <Search:SearchProviderItem Name="PhotoGallerySearchProvider" Template="Default"></Search:SearchProviderItem>
                                <Search:SearchProviderItem Name="GroupSearchProvider" Template="Default"></Search:SearchProviderItem>
                                        <Search:SearchProviderItem Name="CalendarEventSearchProvider" Template="Default"></Search:SearchProviderItem>
                            </SearchProviderItems>
                        </MonoX:Search>
                    </ZoneTemplate>
                </portal:PortalWebPartZoneTableless>


Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
super

super

1/15/2013 4:13:33 PM
I tried removing a few search provider items but they are still showing up when I try to search anything ?

This is my code - As you can see gallery and calender event search have been removed below

<SearchProviderItems>
                               <Search:SearchProviderItem Name="PagesSearchProvider" Template="Default"></Search:SearchProviderItem>
                               <Search:SearchProviderItem Name="BlogSearchProvider" Template="Default"></Search:SearchProviderItem>
                               <Search:SearchProviderItem Name="DiscussionSearchProvider" Template="Default"></Search:SearchProviderItem>
                               <Search:SearchProviderItem Name="NewsSearchProvider" Template="Default"></Search:SearchProviderItem>
                               <Search:SearchProviderItem Name="UserProfileSearchProvider" Template="Default"></Search:SearchProviderItem>
                               
                               <Search:SearchProviderItem Name="GroupSearchProvider" Template="Default"></Search:SearchProviderItem>
                                  
                           </SearchProviderItems>
This content has not been rated yet. 
6018 Reputation 709 Total posts
sam0864

sam0864

1/15/2013 7:04:26 PM
I modified web.config to do that
This content has not been rated yet. 
656 Reputation 79 Total posts
1 2