SharePointlessness Rotating Header Image

Every Problem has a Solution, Even SharePoint Branding

When working with SharePoint branding you often run across the problem of how to properly deploy your work. The best practice for deploying branding is to put it into a feature by creating a wsp.

But what is a wsp or Solution file and how do we create this.  Most of us who are Designers first and SharePoint people second, might never have heard of a wsp before SharePoint.  Let me explain the advantages to using a Solution file.

Creating a wsp for your SharePoint Branding will allow you:

  • Easier ability to troubleshoot site errors. You can turn the feature off and eliminate your branding as the root cause of problems
  • Make it Managed Code, which makes our developers happy and allows us to have a versioned copy of our files.
  • Easier to Update. Having all your files in one package will give you the ability to more easily make changes and updates.
  • Provides a greater sense of control. You can enforce policy around your site branding and even change the behavior around things like new site creation.
  • The other big component is where your files are located. Solutions will allow you to place the files for your branding on your server instead of in the content database.  This will help with performance and page load times.

These are just a few of the reasons that we deploy SharePoint branding as a feature.  But what exactly is a feature and how do we create this mysterious thing.  If you are a developer or have a staff of developers you can enlist their help in creating this.

The long and short of it is, that a solution for SharePoint branding is made using Visual Studio.  In order to make this transition you should set up a solution in Visual Studio much like you would if you were writing a web part. 

I have attached a sample wsp and Visual Studio 2010 project file to this post. You can use this as a basic sample for how you might start to set up your very own branding solution. This sample solution is being provided to you in conjunction with Paul Schaeflein, SharePoint MVP. I am not a developer, so I had to enlist some help to properly form this solution file.

Sample Solution

There are some big tips in working with solutions and moving your files into a proper SharePoint 2010 Branding solution. If you are anything like me, you will have worked your initial branding development using SharePoint Designer.  When it comes time to move your files into Visual Studio you will find yourself asking what is the best method.

I have found that simple exporting your files out and importing them into Visual Studio leaves you open to what I affectionately refer to as SharePoint Designer Gobbledygook. (Yes that is my very own fun technical term) SharePoint Designer is a great tool for working with SharePoint branding, but it has a tendency to create issues when it comes to moving your files outside of it. 

My favorite method for moving files from SharePoint Designer into Visual Studio is to simply copy the code out of your files in SPD and move it into a simple text editor like Notepad. Then when I have Visual Studio open I will create blank files and copy my code out of Notepad into these blank files.

Once you have done this you will still want to check for that gobbledygook. This can come in many formats. The most common are hard returns in the files or the insertion of some SharePoint Designer specific file characters in the head tag and !DOCTYPE declarations. This extra information can and will cause problems for you. So you will want to remove this as you find it.

Working with Visual Studio and SharePoint branding can be a bit of a challenge for those without an understanding of basic SharePoint development, but it is not impossible. Once again, I am providing you with a very basic SharePoint branding solution that you can start to see how it works.

Sample Solution

And again, thanks to Paul Schaeflein for helping me out and writing a solution and agreeing to allow me to share it with all of you.

One Comment

  1. Marzipan says:

    Attended your sharepoint saturday presentation in DC. I would like to download the wireing diagram tool you mentioned. I don’t see how to search your site for your postings from the presentation.

    Thanks,

Leave a Reply

Your email address will not be published. Required fields are marked *