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:
- Log into your SharePoint server
- Copy an existing theme
- Rename OLDTHEME.INF to NEWTHEME.INF and inside replace OldTheme with NewTheme
- Modify TEMPLATE\LAYOUTS\1033\SPTHEMES.XML
- 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:
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
September 16, 2008 at 4:39 am
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!
September 17, 2008 at 5:35 am
[…] is also the main reason of this post. Two days ago I came across a this post from Keith Dahlby from Solutionizing.net about his STSDev Theme solution generator. He wrote that […]
November 28, 2008 at 11:58 am
[…] 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 […]
December 8, 2008 at 5:16 am
[…] 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 […]
January 7, 2011 at 2:33 pm
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.
January 7, 2011 at 8:10 pm
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.