Sharepoint search
Hi,
I am working on Sharepoint 2003.I have a doubt related to the sharepoint search at portal level(http://servername/default.aspx).
This is the code I found in "1033/SPS/default.aspx" for sharepoint search.
<SPSWC:RightBodySectionSearchBox id="RightBodySectionSearchBoxID" runat="server" SearchResultPageURL="SEARCH_HOME" FrameType="None" CacheTimeout="1000" EnableCache="true" />
I think this is a web control given by sharepoint,with this we can get "an advanced search image,a drop down,textbox to enter the keywords and go button".In the drop down list I have seen only one item that is "all sources", I want to add one more search option,For time being I took "one more text box and go button" just beside the sharepoint search,it is working fine.
Instead of adding a new textbox and go button I want to add one more option in the existed sharepoint search drop down which serves my purpose.
Can I edit the sharepoint search web control code(above shown code)?
Or else can I do this-My idea is to write a new webcontrol and replace the existed one.But in this case also I need the existed webcontrol code.
Fast response would be appreciable.
Thanks.
Answers
This is a web control as you thought. The way to change the items in the list is via Search Scopes in SharePoint (http://www.microsoft.com/technet/windowsserver/sharepoint/V2/reskit/c2261881x.mspx#EAMAC). However, this will rely on SharePoint to handle the behaviour of the search - you won't be able to control it per se.
Search scopes allow you to restrict where you search as a user and are defined by an administrator in the Search Settings.
In order to make your own custom control, you'd need to inherit from and extend the existing RightBodySectionSearchBox (part of the Microsoft.SharePoint.Portal.WebControls assembly). Your biggest challengeI suspect will be that this control is referenced from a multitude of portal and area pages which would then need to be updated to use your new control.
Hth.
All Replies
This is a web control as you thought. The way to change the items in the list is via Search Scopes in SharePoint (http://www.microsoft.com/technet/windowsserver/sharepoint/V2/reskit/c2261881x.mspx#EAMAC). However, this will rely on SharePoint to handle the behaviour of the search - you won't be able to control it per se.
Search scopes allow you to restrict where you search as a user and are defined by an administrator in the Search Settings.
In order to make your own custom control, you'd need to inherit from and extend the existing RightBodySectionSearchBox (part of the Microsoft.SharePoint.Portal.WebControls assembly). Your biggest challengeI suspect will be that this control is referenced from a multitude of portal and area pages which would then need to be updated to use your new control.
Hth.