Wednesday, October 9, 2013

How to Customise Default Search Input Box in SharePoint 2010


I’ve had the opportunity to have a request to change the Small Search Input Box. This is the small search box that is usually placed at the top right of a SharePoint page and says “Search this site…”. The requirement was to change the search scope from This Site to search the entire intranet. The result page that was going to be used was already made and worked perfectly. The last thing that was to be done was to change the text in the textbox from “Search this site…” to “Search…”.
The Small Search Input Box is a delegate control and is found in a master page as
1
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" />
This delegate control points to the control that is defined in the feature OSearchBasicFeature. This feature has the SearchArea.xml which contains the actual control definition as follows;
1
2
3
4
5
6
7
8
9
10
11
12
13
Id="SmallSearchInputBox"
Sequence="50"
ControlClass="Microsoft.SharePoint.Portal.WebControls.SearchBoxEx" ControlAssembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
    /_layouts/images/gosearch.gif
    /_layouts/images/goRTL.gif
    /_layouts/images/gosearch.gif
    /_layouts/images/goRTL.gif
    ShowDD
    /_layouts/osssearchresults.aspx
    
    None
The main things to notice here are the sequence number and the properties.
If you define another feature with a Control with the same Id as another delegate control uses, it is the control with the lowest Sequence value that will be used.
Secondly, the properties. If you look at the DropDownMode property it is by default ShowDD, which means the dropdown with the different scopes will be shown. The value can be changed to HideDD if the dropdown should not be visible.
So, to make the customizations to the Out of the box search box, let’s make a new feature and copy the Control tag from the SearchArea.xml to a new elements file. You have to make a new Element in Visual Studio 2010 to get the elements.xml. Then add the element to the feature using the designer. Then make the following changes;
1
2
3
4
5
Sequence = "40"
 
    <Property Name="DropDownMode">HideDD_useDefaultScope</Property>
    <Property Name="SearchResultPageURL">/search/pages/results.aspx</Property>
    <Property Name="QueryPromptString">Search…</Property>
One by one, the lines above will make the following changes:
1
Sequence = "40"
This will ensure that our feature control is used instead of the SharePoint standard.
1
<Property Name="DropDownMode">HideDD_useDefaultScope</Property>
This line will make the most important change that we want, to use the default scope and not showing the dropdown. This will make the default search toward another scope than the This Site scope. The default scope will have to be created later on.
1
<Property Name="SearchResultPageURL">/search/pages/results.aspx</Property>
This line will set the custom results page for the search. This aspx was already made and living happy in the environment. Perfect!
1
<Property Name="QueryPromptString">Search…</Property>
Set the text to be displayed before the user enters any text in the search box.
The only thing that has to be done now is to set a default scope for the Site Collection where the search is being deployed. To change the default scope navigate to _layouts/scopedisplaygroup.aspx?group=0 and make the changes.
Deploy the solution and test that the results are displayed from the correct scope.

Thursday, June 6, 2013

Out and about: New SharePoint mobile offerings


Work is no longer 9-5, nor confined to a single location. People are out and about more than ever and need to be able to access their documents and data whenever and wherever they are. As we shared at SharePoint Conference 2012 in November, we've been working hard on new SharePoint mobile apps so you can access your information from a variety of devices.
I'm excited to share an update on the progress we've made--from the new native apps and how SharePoint document access appears in the native Windows Phone Office Hub to investments in cross-device access across multiple browsers and a new backend feature called Device Channels.

-->

Two new apps available across multiple devices

We're introducing two new apps across multiple devices: the SharePoint Newsfeed app and the SkyDrive Pro app.
The SharePoint Newsfeed app. The SharePoint Newsfeed app--available now for Windows Phone and iOS mobile devices--is the best way to stay connected and be productive while on the go. You can use the SharePoint Newsfeed app to interact with your organization's SharePoint social network, letting you:
  • Create new status posts, use #hashtags, @mention direct to a colleague
  • Add comments to ongoing discussions, read and "like" your colleagues' posts
  • Upload pictures
  • And more...
You can try the new app now, installed directly on your device. The apps will work against a Microsoft Office 365 SharePoint Online account or a properly configured on-premises SharePoint Server.
The new SharePoint Newsfeed app on a Windows Phone.
The new SharePoint Newsfeed app for iOS - left image shows app displayed on an iPad, right image shows app displayed on an iPhone.
The SkyDrive Pro app. As you may know, SkyDrive Pro is cloud storage that organizations provision for employees as part of their SharePoint 2013 on-premises and/or Office 365 SharePoint Online deployments. 
This personal file storage service is for business use, and users can store, access and synchronize their files using the SkyDrive Pro client software.  Users are not limited to synchronizing their personal docs--they can sync any document library to which they have permission (for document libraries where sync is turned on).
As we shared at SharePoint Conference, we're working on native SkyDrive Pro apps for Windows 8 and iOS, both will be coming in summer of 2013. There, too, is a SkyDrive Pro client for Windows - to sync your important documents to your local machine - that ships with Office 2013; also available as a free, standalone installable component. In addition, the capabilities already come natively in Windows Phone (more on that below in the Office Hub section of this post).
You can use the SkyDrive Pro app for Windows 8 and iOS to:
  • View documents in your SkyDrive Pro folder
  • Select specific content to take offline when you travel
  • Upload new content
  • Create new folders and organize