IntroductionIn this article,I will speak that is as useful as a headache.The control of Sharepoint for research is very useful to perform the filtering of our research. Parameterize and Change Control Research MOSS 2007The search control is very useful but difficult to work requiring some imagination and features Features to change CSS to resolve a number of problems associated with layout options and control.So fazo a short article on how to change the control which is not possible through the OOB "Out of the Box" from Sharepoint, who now say there is a friend. Add a Search option in the SharePoint SiteTo add our control to search the site for SharePoint, we can open the Main MasterPage and add the following tag, normally within the ContentPlaceHolder "PlaceHolderSearchArea" <asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server"><SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" /></asp:ContentPlaceHolder> Define "This Site" as Default Scope As we have lot of scopes to investigate the option "This Site" you can not set by default in the search. To accomplish the management control is needed to access Search Feature OSearchEnhacedFeature.The feature has a set of parameters that we can parameterize. C: \ Program Files \ Common Files \ Microsoft Shared \ Web Server Extensions \ 12 \ TEMPLATE \ FEATURES \ OSearchEnhancedFeature
Parameterize the file: Searcharea.xml Change the properties to set the option to search "This Site" by default <property Name="DropDownMode"> ShowDD_DefaultContextual </ Property> Searcharea.xml <? Xml version = "1.0" encoding = "utf-8"?><Elements xmlns = "http://schemas.microsoft.com/sharepoint/"><ControlId = "SmallSearchInputBox"Sequence = "15"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="FrameType"> None </ Property><property Name="ShowAdvancedSearch"> true </ Property><property Name="DropDownMode"> ShowDD_DefaultContextual </ Property></ Control>
</ Elements> Advanced Search Option SetTo add the option "Advanced Search" you would add the following option. <property Name="ShowAdvancedSearch"> true </ Property> Change Image SearchThe tag GoImageUrl has the function which is the default image. <property Name="GoImageUrl"> /_layouts /images /gosearch.gif </ Property> Hide the Search Scopes listTo hide the list of Scope of research we can use our custom *. css and add the following tag: select.ms-searchbox (display: none;) Or we can change the feature "C: \ Program Files \ Common Files \ Microsoft Shared \ web server extensions \ 12 \ TEMPLATE \ FEATURES \ OSearchEnhancedFeature" Tag to hide list of search scopes. <property Name="DropDownMode"> HideScopeDD </ Property> Supporting Document http://social.technet.microsoft.com/Forums/en-US/sharepointsearch/thread/dc35ccf4-bc94-4827-9f16-83478c8642d1 Remove the "This Site" to Search ListTag to remove the "This Site"List of search scopes. <property Name="DropDownMode"> ShowDD_NoContextual </ Property> Also we can use Javascript to remove "This Site"List of search scopes. http://social.technet.microsoft.com/Forums/pt-BR/sharepointsearch/thread/3474cf80-cfa3-489f-97e4-06d988291952 We can set the masterpage of Sharepoint, a piece of Javascript code to hide the "This Site".
In the Body tag properties added "onload" javascript in the rule for hiding in the Scopes list of search option "This Site"using ControlID associated Control Research, Example "Ctl00_PlaceHolderSearchArea_ctl01_SBScopesDDL"
<script type="text/javascript">removeOption function (checkChar) (
var x = document.getElementById ("ctl00_PlaceHolderSearchArea_ctl01_SBScopesDDL");
for (i = 0; i <x.length; i + +) (if (x.options [i]. text.indexOf (checkChar)! = -1) (x.remove (i) i -;)))
</ Script><BODY Scroll="yes" onload="javascript:if (typeof(_spBodyOnLoadWrapper) !='undefined') (_spBodyOnLoadWrapper(); removeOption(':'); }"> Important: Whenever we change the Feature "OSearchEnhancedFeature" research is needed to update the IISRESET Control.
Done, changed the parameterized our best to control the control.
I hope you enjoyed it. |