Sunday, 15 May 2011

Turning on Detailed Error Messages in SharePoint 2010 - SharePoint ignoring value in the CustomErrors tag issue

This is not new but I found the situation in which the following recommended procedure won't work.
  1. On the web server, navigate to the site directory (probably something like: C:\Inetpub\wwwroot\wss\VirtualDirectories\80 )
  2. Open the web.config file in Notepad
  3. Search for the safemode node with the word "CallStack" and change the CallStack status to true
    <SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">
  4. Search for the CustomErrors node and set the mode to Off
    <customErrors mode="Off" />
  5. Save and close.
So what to do if you update web.config and you still can't see detailed error messages?


The problem is that you're probably running into the error in the _layouts subfolder. In that case the solution is easy:


  1. On the web server, navigate to the c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS folder
  2. Open the web.config file in Notepad
  3. Search for the CustomErrors node and set the mode to Off
    <customErrors mode="Off" />
  4. Save and close.
Hope this helps,

David



Force to open InfoPath forms in the browser

If you were working with browser-based InfoPath forms in SharePoint 2007/2010, you might run into a really annoying issue. In some situations the forms are opening in the client application, this usually happens when:
  1. You have InfoPath application installed on your computer.
  2. You're opening the form from within the task (e.g. task in Approval workflow) - see next picture

To overcome this problem, I created a simple SharePoint solution which forces SharePoint to open the form inside browser. It uses JQuery framework and it's packaged into the standard SharePoint solution. All you need to do is to install the solution and activate Open InfoPath forms in browser feature under Site Collection Features.

You can download the solution here.

Hope this helps,

David

Tuesday, 10 May 2011

Prompt when opening PDF in SharePoint

This is a really annoying problem. You can see on the next screenshot what I'm talking about.


Why SharePoint just can't download the file and open it? It's the PDF file so you can't edit it anyway.

To be honest, we can't blame SharePoint in this situation. The SharePoint starts to treat PDF files this way after you install PDF iFilter and modify docIcon.xml file in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML folder.

In this article by Microsoft you can find that when installing PDF iFilter you need to add <Mapping Key="pdf" Value="pdf16.gif" /> entry to docIcon.xml file. The entry should be <Mapping Key="pdf" Value="pdf16.gif" OpenControl="" />. After you update the entry and restart IIS using iisreset, everything should be OK:




Hope this helps,

David

Monday, 9 May 2011

Publishing site with multiple master pages

OK, let's be honest, this is not a common scenario. Usually you can live only with one master page and it should be enough for everyone. But from time to time you run to crazy clients which want to rape the SharePoint and turn it upside down.

You'll need another master page if you want to create page/pages inside SharePoint site which are a quite different from your current master page. It could be a different page structure or look and feel.

To implement multiple master pages you need to:
  1. Install DavidK.SP.Publishing.wsp solution
  2. Create a custom master page
  3. Create a custom page layout which will reference your custom master page. The easiest way to do this is to copy BlankWebPartPage.aspx, then edit the page layout and change the Inherits attribute to:

    DavidK.SP.Publishing.PageLayoutWithCustomMasterPage,DavidK.SP.Publishing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a9645fc7d9034814

    Also, add the MasterPageFile attribute which should contain the path to custom master page. In my case it is the following string:

    MasterPageFile="/_catalogs/masterpage/DavidK_custom.master"


Page layout with a custom master page
That's all, just check in the master page and page layout, approve it and create a new publishing page from this page layout.

Hope this helps,

David

Wednesday, 4 May 2011

SharePoint 2010 RSS Feeds Aggregator

For those who would like to aggregate the RSS feeds from multiple lists/document libraries in SharePoint, I developed the SharePoint 2010 RSS Feeds Aggregator. The aggregator is just a ASPX page which generates aggregated RSS feeds depending on the parameters passed in URL. You can also configure the title, link and description of the final RSS feed xml. The URL can be then used in the standard SharePoint RSS viewer webpart or together with any third-party RSS webpart.

After installation of the SharePoint solution, simply go to the following page: 
http://<your-sharepoint-server>/layouts/DavidK.Sp.RssAggregator/rssaggregator.aspx 

This page contains instructions and the sample settings.

If you encounter "The RSS webpart does not support authenticated feeds" error while configuring the RSS viewer werbpart, you need to change the authentication provider settings from NTLM to Kerberos:
  1. Go to SharePoint 2010 Central Administration and click on the Manage web Application
  2. Select your web application and click on the Authentication Providers
  3. Click on the zone and under the IIS Authentication Settings select Negotiate (Kerberos)
Apart from this you don't need to configure anything else.

You can download the solution from here.

Configuration

Sample output