Partager via


Removing contextual "This site"scope from simple search box

Mark has a great post on Search scopes and the special contextual scopes. Good stuff Mark!

If you want to remove the "This site" contextual scope all together, then this cannot be done using standard user interface. You need to create a new feature based on one of the existing ones. The sample below replaces the collaboration portal search box with a delegate without the "This site" contextual scopes.

  1. Make a copy the existing feature OSearchEnhancedFeature (MOSS Enterprise ed.)
  2. Change the sequence number to fit below 25, e.g.

 <Control
        Id="SmallSearchInputBox"
        Sequence="15"
        ControlClass="Microsoft.SharePoint.Portal.WebControls.SearchBoxEx" ControlAssembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">

     3. Add the DropDownMode property

 <Property Name="DropDownMode">ShowDD_NoContextual</Property>

 

All you need to do now is to package the feature in solution and deploy it. You can do it manually, or use something like the WSPBuilder