Custom Search in SharePoint

No.of Views2058
Bookmarked0 times
Downloads 
Votes1
By  André Lage   On  30 Jun 2010 12:06:13
Tag : SharePoint , Enterprise Content Management
In this article,I will speak that is as useful as a headache.
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

In 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 2007

The 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 Site

To 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>

 

Image Loading

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

Image Loading

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>

 

Image Loading

Advanced Search Option Set

To add the option "Advanced Search" you would add the following option.

<property Name="ShowAdvancedSearch"> true </ Property>

 

Image Loading

Change Image Search

Image Loading

The tag GoImageUrl has the function which is the default image.

<property Name="GoImageUrl"> /_layouts /images /gosearch.gif </ Property> 

 Hide the Search Scopes list

To 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>

 

Image Loading

Supporting Document
http://social.technet.microsoft.com/Forums/en-US/sharepointsearch/thread/dc35ccf4-bc94-4827-9f16-83478c8642d1

Remove the "This Site" to Search List

Image Loading

Tag 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.

 
Sign Up to vote for this article
 
About Author
 
André Lage
Occupation-Not Provided
Company-Not Provided
Member Type-Senior
Location-Portugal
Joined date-09 Jun 2010
Home Page-Not Provided
Blog Page-Not Provided
 
 
Other popularSectionarticles
    In this article, I'm going to explain how to create List of Definition in SharePoint 2010.The List Definition is brand new features in SharePoint 2010.
    Published Date : 22/Sep/2011
    Now its a time user need Rich User Interface with high level of interactivity that is easily possible with xhtml technologies
    Published Date : 21/Jun/2010
    Difference between MOSS and WSS
    Published Date : 16/Feb/2010
    In this article, I am going to give and walkthrough of how to define a custom Content type in MOSS or SharePoint.
    Published Date : 16/Feb/2010
    Recently I have involved in branding one of our clients sharepoint portal. As part of the branding process we needed to modify the application.master file, so even the layout pages will have the same look and feel. As part of the investigation, we come up with the best approach for doing this.
    Published Date : 05/Sep/2010
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top