Tag Archives: Microsoft SharePoint

Open SharePoint 2013 Search Results In The Client Application

If you configure SharePoint 2013 to work with Office Web Apps (link), by default SharePoint will open Word, Excel etc. documents in the browser using the Office Web Apps.  You can configure SharePoint to open documents in the client application or browser on a site collection or document library basis, see here.  However, even if you choose to configure SharePoint to open documents in the client application at the site collection, search results still open in the browser.  In my case I wanted Office Web App integration to enable search result previews, but I wanted search results to open in the client application.

In order to open search results in the client application I had to alter the Item_CommonItem_Body.html search results display template.  Item_CommonItem_Body.html is the display template that’s rendered  by _#=ctx.RenderBody(ctx)=#_ within a display template.  Below is the section in one of my custom display templates.

Search2013WebApps1For an overview of display templates read this MS Technet blog article.

Within Item_CommonItem_Body.html is a section that references ctx.ScriptApplicationManager.states.openDocumentsInClient.

Search2013WebApps2

In order to force search results to open in the client application I added a line in my custom display template to set the value of ctx.ScriptApplicationManager.states.openDocumentsInClient to true.

Search2013WebApps3

Open in Client Detail

This results in the behavior where search result previews using Office Web Apps still work, but when a user clicks on a result it opens in the client application.

 

Enabling SharePoint Search With An Active Directory Forest Trust

Having configured SharePoint 2010 Search I had a problem whereby some users received zero results when searching SharePoint content.

In this configuration SharePoint was in one forest (A) and the users who got zero results were in another forest (B).  Users in the A forest were able to search and get results.  In order to resolve the issue I had to convert the SharePoint Search Service Application to store the SharePoint ACLs in Claims format.

To convert the SharePoint Search Service Application open the SharePoint Management Shell and run Get-SPServiceApplication.  Copy the ID of the Search Service Application.

SPSearchClaims1

 

Now run the code below replacing %SearchServiceID% with your Search Service Application ID.

$SearchApp = Get-SPServiceApplication %SearchServiceID%
$SearchApp.setproperty(“ForceClaimACLs”, 1)

Run a full crawl and users in the other forest will get search results.

Updating SharePoint 2010 Web Parts For SharePoint 2013

Following an upgrade from SharePoint 2010 to 2013 I deployed some custom web parts.  When loading the page I received the error “/_CONTROLTEMPLATES/WEBPARTNAME/VisualWebPart1/VisualWebPart1UserControl.ascx” does not exist.

2013WebPartError1

The error is caused by the web part looking in the \14\TEMPLATE\CONTROLTEMPLATES folder rather than \15\TEMPLATE\CONTROLTEMPLATES.  Open the web part solution in Visual Studio and change the _ascxPath string.  Original value below:

2013WebPartError2

 

Change the string to include the 15 folder.

2013WebPartError3

 

Rebuild and re-deploy the web part.

 

Renaming SharePoint Taxonomy Terms

If you rename a taxonomy term in SharePoint, the change doesn’t take effect instantly.  You have to wait for the SharePoint Timer Job “Taxonomy Update Scheduler” to run, which by default is every 1 hour.

If you want the change to take place immediately, or to change the job schedule, open Central Administration -> Monitoring -> Review job definitions.  Scroll through the jobs until you reach the Taxonomy Update Schedule for the web application where you made the change.  Click on the job title and click Run Now, or reschedule the job.

SharePoint 2013 Hide Left Hand Navigation Bar

Hiding the left hand navigation bar in SharePoint 2013 proved a little tricker than I expected.

RemLHNav1

 

My initial attempt to hide the navigation using CSS was to hide #sideNavBox.

RemLHNav2

 

However, I found this had the side effect of hiding the search refiners on /_layouts/15/osssearchresults.aspx.  I settled on hiding .ms-core-sideNavBox-removeLeftMargin as this doesn’t appear to have any side effects.

RemLHNav3

SharePoint 2013 Global Navigation Styling CSS

This is a quick post to show the CSS I used to style the global navigation / top navigation in SharePoint 2013.

I’ve used bright and different colours to make each CSS section easy to identify.  The top level is in blue, when you hover over a link it changes to aqua.  Hovering over a drop down item changes it to lime.

SP2103TopNavCSS1

SP2103TopNavCSS2 SP2103TopNavCSS3 SP2103TopNavCSS4

 

By default SharePoint wraps the menu item text, producing a result as below.

TopNavWrap1

 

In order to ensure all each menu item is displayed on one line I had to update ul.dynamic as below, using min-width, white-space: no wrap and word-wrap: normal.

TopNavWrap2

 

This is the result.

TopNavWrap3

Upgrading SharePoint 2010 To SharePoint 2013 Part 5

These are notes from my first upgrade of SharePoint 2010 to SharePoint 2013.  The purpose of the upgrade is to carry out an initial test upgrade to find any issues etc.  I’m not replicating the environment in terms of server roles etc. everything is installed on one server with local SQL.  I followed the steps outlined here: http://technet.microsoft.com/en-us/library/cc303436.aspx

This is part 5, part 1 can be found here, part 2 here, part 3 here and part 4 here.

Upgrade a site collection to SharePoint 2013

Reference: http://technet.microsoft.com/en-us/library/jj219650.aspx

Once the databases have been upgraded you can upgrade individual site collections.  You will see the notification bar at the top of the site with the option Start now or Remind me later.

Before beginning the site collection upgrade run health checks from Site Settings -> Site Collection Administration -> Site collection health checks.

On the run site collection health checks page, click Start checks.

After reviewing the health check results begin the site collection upgrade.  From the Site Settings page, click Site collection upgrade beneath Site Collection Administration.

On the following page, click Upgrade this Site Collection.

Once the upgrade has completed verify the upgrade from the Upgrade status page.  Go to Site Settings -> Site Collection Administration -> Site collection upgrade.  On this page click Review Site Collection Upgrade Status.

Finally, review everything is working and looks as you’d expect.

Additional configuration tweaks

Grant the default content access account the  “Retrieve People Data for Search Crawlers” permission for the User Profile Service application.

Configure the object cache user accounts http://technet.microsoft.com/en-us/library/ff758656.aspx

Enable the blob cache http://technet.microsoft.com/en-us/library/ee424404.aspx