Freitag, 13. August 2010

How to change the default search scope from "all sites" to "this site:xx"

By default SharePoint sites comes with a number of search scopes: People All Sites besides the implicit search scopes which change according to the context: This Site This List
The default search scope in the sharepoint is "All sites", but sometimes the client request "This site:xx" set as the default scope. Maybe some one will suggest to modify the setting directly via Sharepoint Designer. But only for one site, the solution is not problem. For more than 100 sites, how to deal with it?
In order to solve such problem, customing code should be added to the search feature file. The following line ShowDD_DefaultContextual should be added to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\OSearchEnhancedFeature\SearchArea.xml
and the file will be:
http://schemas.microsoft.com/sharepoint/"> /_layouts/images/gosearch.gif /_layouts/images/goRTL.gif /_layouts/images/gosearch.gif /_layouts/images/goRTL.gif true None true ShowDD_DefaultContextual
In order to avoid the Sharepoint Upgrade problem in the future, we suggest you to write a new feature for the change and deploy the feature to the site collection.

Keine Kommentare:

Kommentar veröffentlichen