locked
Removing ThisSite: from Search DropDown? RRS feed

  • Question

  •  

    Is it possible to remove ThisSite: from the search dropdown of a site collection, or is it possible to modify the OSSearchResults.aspx page for that site?

     

    Business Problem: We store PDF copies of our CAD drawings in SharePoint. Based on each drawing's status, we want to display a message to the user about whether or not that drawing should be used on the manufacturing floor. We modified our search results XSL everywhere that the user could possibly find a drawing. Everywhere except the ThisSite: search on the actual site collection. We either need to take this option away or modify the page to include our custom XSL.

     

    Thanks.

    • Edited by Mike Walsh FIN Tuesday, January 4, 2011 10:06 AM One ? is enough
    Sunday, January 27, 2008 5:31 PM

Answers

  • Another possible way is to modify the SearchArea.xml

     

    Located in

    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\OSearchEnhancedFeature

     

    Add the bold element Name="DropDownMode"

    This will hide the drop down list but leave the search box.

     

    <?xml version="1.0" encoding="utf-8" ?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
        <Control
            Id="SmallSearchInputBox"
            Sequence="25"
            ControlClass="Microsoft.SharePoint.Portal.WebControls.SearchBoxEx" ControlAssembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
     <Property Name="GoImageUrl">/_layouts/images/gosearch.gif</Property>
     <Property Name="GoImageUrlRTL">/_layouts/images/goRTL.gif</Property>
     <Property Name="GoImageActiveUrl">/_layouts/images/gosearch.gif</Property>
     <Property Name="GoImageActiveUrlRTL">/_layouts/images/goRTL.gif</Property>
            <Property Name="UseSiteDefaults">true</Property>
      <Property Name="DropDownMode">HideScopeDD</Property>
     <Property Name="FrameType">None</Property>
            <Property Name="ShowAdvancedSearch">true</Property>
        </Control>   
    </Elements>

     

    Or use <Property Name="DropDownMode">ShowDD_NoContextual</Property> to remove "This site" from the drop down.

     

    Monday, January 28, 2008 10:17 PM

All replies

  • Murray --

     

    I don't know if this is exactly the solution you're looking for, but Mark Arend has an excellent post detailing how to create your own custom replacement for the Search Results page.  You may be able to follow his example to create a new results page for the ThisSite scope to include your custom XSL.

    http://blogs.msdn.com/markarend/archive/2007/01/24/search-results-page-may-be-different-per-search-scope.aspx

     

    John

    Monday, January 28, 2008 2:32 AM
  • That was more involved than I was hoping for, but thanks for the response. I was hoping for an easy way to turn off the ThisSite/Library search or to route those searches using our predefined scopes to our central Search Center. It sounds like neither is an option through the UI.

     

    Monday, January 28, 2008 5:57 PM
  •  

    Well you could create your own site template and modify the default.aspx and remove the bold section.

    This removes the search box and list from the page.

     

    <asp:Content ContentPlaceHolderId="PlaceHolderSearchArea" runat="server">
     <SharePointBig SmileelegateControl runat="server"
      ControlId="SmallSearchInputBox" />

    </asp:Content>

     

     

     If you do not want to create a site template you could modify the existing site template for instance

     

    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\sts\default.aspx is for team sites.

     

    However, any service pack updates may over write your changes.

    Monday, January 28, 2008 9:37 PM
  • Another possible way is to modify the SearchArea.xml

     

    Located in

    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\OSearchEnhancedFeature

     

    Add the bold element Name="DropDownMode"

    This will hide the drop down list but leave the search box.

     

    <?xml version="1.0" encoding="utf-8" ?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
        <Control
            Id="SmallSearchInputBox"
            Sequence="25"
            ControlClass="Microsoft.SharePoint.Portal.WebControls.SearchBoxEx" ControlAssembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
     <Property Name="GoImageUrl">/_layouts/images/gosearch.gif</Property>
     <Property Name="GoImageUrlRTL">/_layouts/images/goRTL.gif</Property>
     <Property Name="GoImageActiveUrl">/_layouts/images/gosearch.gif</Property>
     <Property Name="GoImageActiveUrlRTL">/_layouts/images/goRTL.gif</Property>
            <Property Name="UseSiteDefaults">true</Property>
      <Property Name="DropDownMode">HideScopeDD</Property>
     <Property Name="FrameType">None</Property>
            <Property Name="ShowAdvancedSearch">true</Property>
        </Control>   
    </Elements>

     

    Or use <Property Name="DropDownMode">ShowDD_NoContextual</Property> to remove "This site" from the drop down.

     

    Monday, January 28, 2008 10:17 PM
  • Thanks.  This helped me a lot.  I wanted to set the default search scope to the contextual scope (such as this site, this list or this library) and could not figure out how to do it. 

    I was able to set the default to the contextual scope by setting the DropDownMode as follows: <Property Name="DropDownMode">ShowDD_DefaultContextual</Property>.
    Friday, August 8, 2008 6:35 PM