The standard SharePoint site templates delivered by Microsoft include a delegate web control named “SearchBox”. This control is placed on a high-level master page that is inherited by nearly all other pages in each SharePoint site collection. This control creates a simple input field for searching.
In the default Microsoft configuration, the “SearchBox” delegate control creates a search form that targets the default Microsoft search center. The delegate does this by loading the standard Microsoft search-box Web part. However, when you install and activate Search & Preview (either the full Search & Preview feature for a given site collection or the Search-Box-only feature for a given web application), all affected delegates are retargeted to the Search & Preview Web control, which creates a simple Search & Preview input form. This control is similar to the Microsoft control, except for the following:
• The Search & Preview search box targets the Search & Preview search center.
• It formats the query as expected by Search & Preview
• It includes referrer information, which enables Search & Preview to respond differently based on where the user was when initiating the search (i.e., on which subsite in the collection).
• As with the Microsoft control, the Search & Preview control provides a scope drop-down list. Like the referrer, Search & Preview uses this to fine-tune the search response with extra filtering and formatting options.
Note, however, that the automatic install, activate and deactivate functionality requires that the delegate control is named “SearchBox”, as in the default SharePoint configuration. If you have customized your site so that it does not include this control, or if you have renamed the control, then you can create your own search box by placing the Search & Preview control wherever you need it. The Search & Preview Search Box assembly class has the following namespace and name:
See your SharePoint documentation if you are not sure how to make use of the above code to place a web part on your pages.
When you deactivate the Search & Preview and/or the Search & Preview Search Box feature, then the delegate web control will automatically revert to its default Microsoft behavior as follows:
• Deactivate the Search & Preview Search Box feature at the web application level to revert the search box for all site collections that do not have the full Search & Preview feature activated.
• Deactivate the full Search & Preview feature at the site collection level to revert the search box for each selected site collection belonging to an application where the Search & Preview Search Box feature is also deactivated at the web application level.
Need more help with this?
CONTACT US info@ontolica.com OR use our homepage