Introducing the Template Library Connector for SharePoint 2010

Are you annoyed that you have to create a new content type for every Office document template you want to publish in SharePoint 2010? Do you think it’s stupid that the SharePoint administrator has to re-publish that content type just because someone updated the document template? Are you disappointed that you cannot create a tree structure under the “New Document” button?

If so, you might want to consider the Template Library Connector for SharePoint 2010.

With the Template Library Connector you can choose any existing document library to be the source of document templates for your document library. You can choose as many sources as you want for each library, and all your libraries can have different sources.

Template Library Connector for SharePoint 2010

The new button "New from Template" is part of the Template Library Connector for SharePoint 2010

Depending on the size of your SharePoint 2010 environment, you can choose to designate a site collection to be your template hub, and put all template libraries there, or you can use your local site collection as its own source.

With the template library connector, you can keep the content types down to a sensible number. Say you have a contract template translated to five languages. Normally you would need five content types to publish these templates. If you were smart, you created one master with the site columns, but you would still need one dummy content type to attach the template. Now you can instead create one content type called Contract, and then assign this content type to all five templates.

When there is a change to a template, the template owner or a super user can simply go to the template library and edit the template directly. No re-publishing is needed, the updated template is immediately available in all subscribing libraries.

The template owners can organize their templates in a folder structure, and this structure is mirrored in the template selector modal window. This way you can have as many templates as you want available in a document library.

I created a couple of screen casts for those who prefer that: config and use. I also added some documentation on the codeplex site.

Go ahead and try it out, and please post comments and suggestions below this post.

Big thanks to Einar Otto Stangvik who created the Template Library Connector for MOSS2007, and to Henrik Næss who contributed to the connector for SharePoint 2010.


About Øystein Garnes

Software Project Manager, former .Net and SharePoint 2010 developer, husband, Boston Terrier owner, amateur caveman chef, amateur genealogist, cross country skier, food blogger.
This entry was posted in SharePoint and tagged . Bookmark the permalink.

29 Responses to Introducing the Template Library Connector for SharePoint 2010

  1. This looks really great! I wish this was made 6 month ago when I had to create something allmost identical for a customer. Next time I will consider using yours! 🙂

  2. Hi.

    Awsome initiative 🙂
    I was just about to start on porting this project to 2010 as well (or create a similar one based on Grep’s).

    I manage to deploy the soluton and activate the Feature at Site Collection level, but I think there might be a small bug regarding the redirect/transfer when clicking “Save” in the Template Library Connector Settings Page (TemplateLibraryConnectorConfig.aspx).
    It seems like the code is always redirecting to ListEdit.aspx at Site Collection level, instead of the current subsite, if applicable.

    And also, is there a chance that you also could release the source code for the project as well?

    Thx again. Keep up the good work!


    • Hi Øyvind,

      Thanks for the bug report. I have fixed the issue now, please download the new version and let me know if it works as expected.

      The source code is available under the Source code tab. Have a good week end!


  3. Eric Fang says:

    You did awesome job! Microsoft should pay you 🙂

  4. The Template Library Connector has been chosen as the “Cool Tool” in this week’s SharePoint Newsletter:

  5. Paul says:

    Oystein, I’ve installed this and it works well – except it is throwing an error (in the dialogue box) when clicking the “New From Template” button if on a subsite, and the library is at the parent root site.

    An unexpected error has occurred.
    Troubleshoot issues with Microsoft SharePoint Foundation.
    Correlation ID: a9e8ce1c-cd53-4a4d-b2cb-c5607fb78a92

    The corresponding error shows;

    System.NullReferenceException: Object reference not set to an instance of an object.
    at TemplateLibraryConnector.Selector.Page_Load(Object sender, EventArgs e)
    at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
    at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
    at System.Web.UI.Control.OnLoad(EventArgs e)
    at Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.OnLoad(EventArgs e)
    at Microsoft.SharePoint.WebControls.LayoutsPageBase.OnLoad(EventArgs e)
    at System.Web.UI.Control.LoadRecursive()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    • Hi Paul,

      Thanks for reporting the error. Unfortunately, I have no time for debugging the upcoming weeks, but I’ll look at it as soon as possible. You can of course debug it yourself if you want, the source code is available for download on codeplex.

      Best Regards
      Øystein Garnes

      • Samrein says:

        Is there allready a solution?
        Have the same problem…

      • Hi Samrein,
        As you can see on the download page on codeplex, nothing has been fixed on the template library connector in over a year. I had big plans, but unfortunately I never found time to work with it. In fact, I am not even working with SharePoint at all anymore.

        I suggest you take a look at the project, which is a fork of the template library connector. The templatehub also hav a lot more functionality.

  6. Christos K says:

    Can it be used with Office 2003? Thank you

  7. Christian Grunert says:

    It seems that it is substituting the “New Document”-Button with its own “New from Template”-Button in all documents libraries even if this feature is not activated for a specific document library.

    We have also faced the problem with document libraries on subsites requiring document templates from a parent site like Paul aforementioned.

    • Hi Christian,

      Yes, this is a known shortcoming of the current version. As I wrote on the codeplex documentation: “In the current version, the connector is activated on a site collection level. When activated, the New Document ribbon button is replaced with a New from Template button in all document libraries in the site collection.”

      The reason for this is that the organization I created it for use site collections wherever they need a site, so it was made with only site collections in mind.

      I’d appreciate it if you could create an issue on this (and maybe for the other issue as well?) at codeplex and I’ll try to implement a better solution.

      Best Regards,
      Øystein Garnes

      • Christian Grunert says:

        Hi Øystein,

        You are right. I set them both as issues on codeplex. Thank you for taking care.

        Best regards,

      • Thanks Christian,

        I will take a look at it as soon as I find time, next week might have an opening.

        Best Regards,
        Øystein Garnes

  8. sheldon says:

    Hi Øystein

    I have a CTH hub pushing out content types to multiple site collections.
    How would this tool handle metadata based site columns in different site collections?

    Kind regards

    • Hi Sheldon,

      The way I have done it, is to create content types in the content type hub, and then subscribe to these in the template hub and in the site collections using the template hub (i.e. using the connector). When you set a template to be of a certain content type, the resulting document will also have that content type, as long as both the template hub and the user’s site are subscribing to that content type from the hub.

      Did that make sense? 🙂

      Best Regards,
      Øystein Garnes

      • Sheldon says:

        Hi Øystein

        Thanks for the quick reply.
        “…and then subscribe to these [content types] in the template hub and in the site collections using the template hub (i.e. using the connector). ”
        If I am understand you correctly you are saying that the template hub is separate site collection from the site collections that are subscribing to the content types – using the content type publishing feature. It is my understanding that the connector works at a site collection level, how can you subscribe to a template hub in another site collection. your reply also infers that you are able to set the templates using your tool to content types as well as libraries, is this correct?
        Lastly are you able to confirm if you have done this using content types that contain site columns and if the site columns can be assocaited to quick part fields within the document instance resulting from the template hubs subscribed too?

        Thanks again

      • Hi Sheldon,

        I think maybe I forgot to write about the template hub. I think maybe the version I uploaded is configured to just use the current site collection for templates, and not a separate template hub. In the version I made for my client, I designated a separate site collection for templates. Sorry about this, I would have to look into the code to see how this can be changed.

        If you are a developer, you can download the source code and change it yourself. After all, it is just a URL. The connector does not care about where the templates are located, as long as the user has read access there.

        Now for your last question, I’m not sure I understand you correctly, but I think the answer is yes. If you see my article about how to insert SharePoint ID in Word documents, this uses quick parts and inserts document ID from the SharePoint site collection into the document. This is indeed compatible with the Template Library Connector.

        Best Regards
        Øystein Garnes

  9. Sheldon says:

    Hi Øystein

    Just re-read my post, to be clear the site columns I am referring to are site columns of type managed metadata.


  10. Sheldon says:

    Hi Øystein

    Thanks for your quick reply once again. I am a developer so sorted tried the hub approach yesterday once I downloaded the source.

    Content type fields at a site collection level level filter down into the quick parts but not using the hub approach, dip panel fields show but don’t hook up to their corresponding quick parts.

    I am now looking at how to do this binding in the OpenXML field. At this point I believe the reason for this is the taxomony field value comes from the WSSID – which answers the question why the custom property values aren’t set until the document is saved to the library. This of course will be different for each site collection as this is specific to the sharepoint site collection root.

    Thanks for your help all the same.


    • Hi Sheldon,

      As I have not been working with SharePoint for more than six months now, I don’t remember the details here. I am now concerned with modernizing a legacy enterprise client server application, and I think I’ll be doing that for quite some time… Also, I have no SharePoint environment to play around with either, so I won’t be of much help for you I’m afraid.

      You might find some helpful information in my blogpost Insert SharePoint 2010 Document ID in a Word document

      Good luck!
      Øystein Garnes

  11. Justin P. says:

    I don’t have a Sharepoint Server environment, or much Visual Studio experience. Would it be possible to upload such great template solution on a Office365/Sharepoint Online?


    • Hi Justin,
      I have never tried Office365/Sharepoint Online, but I doubt you can do such changes there.

      Best Regards,
      Øystein Garnes

      • Eric Fang says:

        Øystein Garnes is right. Office365 asks for Sandboxed solution, and “Template Library Connector” needs to create files in SharePoint system folders, which means we cannot make it a Sandboxed solution.

  12. santosh kanase says:

    Hi Oystein
    Is there is solution devloped for subsite level , we are facing issue on subsite document library
    as mentioned by paul for subsite document library….
    An unexpected error has occurred.
    Troubleshoot issues with Microsoft SharePoint Foundation.
    Correlation ID: a9e8ce1c-cd53-4a4d-b2cb-c5607fb78a92

    pls let me know thanks

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s