STSDEV Theme Solution Generator

SharePoint for End Users just put up up a post about custom themes that echoed the same process that has been repeated several times before:

  1. Log into your SharePoint server
  2. Copy an existing theme
  3. Rename OLDTHEME.INF to NEWTHEME.INF and inside replace OldTheme with NewTheme
  5. Modify theme.css, images, etc.

I like this article in particular because it points out to the “end user” the un/ghosting caveat of SPD customizations that administrators despise and most developers learn on day 1. But it still advises the changes be made directly on the file system, with no mention of how that should be done. Sure it’s an end user audience, but modifying the hive should bump it squarely out of beginner territory.

That said, one of the comments got me thinking:

I have just one question. Is there a way to deploy custom themes as a solution?

Well, we developers all know the answer is yes. I’ve previously discussed updating SPTHEMES.XML, and there are several tools (WSPBuilder, STSDEV, VSeWSS (in theory)…) that can handle “solutionizing” the theme resources, but there has to be a better way. And through STSDEV‘s solution provider interface, there is!


Suppose getting started on a new theme were as simple as this:

  1. Create Solution
    STS Theme Generator - Create Solution
  2. Pick Theme Template
  3. Enter Theme Details
  4. Solutionized!

The solution provider copies the existing theme, renames the .INF, does the search and replace, and even builds a farm-scoped feature complete with receiver to update SPTHEMES.XML. The current STSDEV release (1.3) doesn’t populate the feature receiver assembly, but after adding that to feature.xml the solution should be ready to customize and deploy.

I need to clean up the code a bit before I put it on CodePlex, but in the meantime you can download the binary here: STSDEV 1.3a with Theme Generator. If you’re new to STSDEV, check out Ted‘s Tutorial Screencasts (scroll down) to get started. And if you have any problems or feature requests, please let me know. One idea that I’m already planning to implement is an option to convert a theme to use Heather Solomon‘s @import technique.

Update 12/11/2008: An updated release is available here: STSDEV 1.3b with Theme Generator


6 Responses to “STSDEV Theme Solution Generator”

  1. Dennis Says:

    First thing that came to my mind, when I saw your project on Codeplex, was the import technique. Glad to see that you already had the same idea. Looking forward to the implementation of that option.

    Already tried the theme solution generator and it works great. Nice job!

  2. Expiscornovus » Blog Archive » How to create & deploy a custom theme in MOSS? Says:

    […] is also the main reason of this post. Two days ago I came across a this post from Keith Dahlby from about his STSDev Theme solution generator. He wrote that […]

  3. Theme-amajig: Updating SPTHEMES.XML Through a Feature « Solutionizing .NET Says:

    […] on Codeplex with sample code: Sample Generated Theme Solution; you can generate your own with my STSDEV Theme Solution Generator. Possibly related posts: (automatically generated)HttpModule to set the default themeDeliver a […]

  4. STSDev Theme Solution Generator Update « Solutionizing .NET Says:

    […] 8, 2008 — Keith Dahlby It took a bit longer than expected, but I have finally revisited my STSDEV Theme Solution Generator. I just posted a new release on CodePlex—STSDEV 1.3b with Theme Generator—and the full source […]

  5. TeckniX Says:

    Just now getting to use this tool –
    Everything seem to be somewhat straight-forward, but I don’t think that the ‘RootFiles’ setup is correct – By default it should be ’12’ as this is the hive that sharepoint 2007 uses.

    Also this doesn’t seem to correctly build the Theme as a feature and does not touch on feature Stapling, so that the theme is used when a certain template is being called.

    • Keith Dahlby Says:

      RootFiles is just how STSDev builds solutions, at least as of when I made this. You can certainly adapt the elements you like as needed.

      I’m not sure how you mean not building the Theme as a feature – the purpose here is only a farm-scoped feature to get the theme files onto the server in the correct spot. Beyond that, you’re on your own. If you get a good stapling template put together, I’d gladly accept a pull request on CodePlex.

Comments are closed.

%d bloggers like this: