<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DevExpertise &#187; Themes</title>
	<atom:link href="http://www.devexpertise.com/tag/themes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.devexpertise.com</link>
	<description>Practical tips and tricks for all things .NET, SharePoint, Silverlight, InfoPath, and general application development.</description>
	<lastBuildDate>Wed, 12 May 2010 14:32:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ten Free SharePoint Themes</title>
		<link>http://www.devexpertise.com/2009/03/20/ten-free-sharepoint-themes/</link>
		<comments>http://www.devexpertise.com/2009/03/20/ten-free-sharepoint-themes/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 12:59:11 +0000</pubDate>
		<dc:creator>DevExpert</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint UI]]></category>
		<category><![CDATA[Themes]]></category>

		<guid isPermaLink="false">http://www.devexpertise.com/2009/03/20/ten-free-sharepoint-themes/</guid>
		<description><![CDATA[The Ten Themes for SharePoint in VSeWSS was just released and contains 10 very cool themes, absolutely free and full of glitzy eye candy.&#160; I personally don’t use VSeWSS, but you can just extract the contents of the MSI file and pull out the THEMES and LAYOUTS folders within the Visual Studio solutions, and use [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=0a87658f-20b8-4dcc-ad7a-09ad22641f3a" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.microsoft.com');">Ten Themes for SharePoint in VSeWSS</a> was just released and contains 10 very cool themes, absolutely free and full of glitzy eye candy.&#160; I personally don’t use VSeWSS, but you can just extract the contents of the MSI file and pull out the THEMES and LAYOUTS folders within the Visual Studio solutions, and use that for a custom theme.&#160; </p>
<p>For tips and tricks on how to properly deploy themes to your SharePoint environment, take a look at my previous post <a href="http://www.devexpertise.com/2009/02/11/installing-a-theme-as-a-sharepoint-feature/" >here</a>, and you may also be interested in the Vista theme I put together that I describe <a href="http://www.devexpertise.com/2009/02/09/creating-a-custom-vista-theme-for-sharepoint/" >here</a>.</p>
<p>Here are screenshots of the ten free themes:</p>
<p><strong><em>Construction:</em></strong></p>
<p><a href="http://www.devexpertise.com/wp-content/uploads/2009/03/construction-preview.jpg"  rel="lightbox"><img title="Construction_Preview" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="628" alt="Construction_Preview" src="http://www.devexpertise.com/wp-content/uploads/2009/03/construction-preview-thumb.jpg" width="720" border="0" /></a><strong><em>        <br /></em></strong></p>
<p><strong><em>Contoso</em>:</strong></p>
<p><a href="http://www.devexpertise.com/wp-content/uploads/2009/03/contoso-preview.jpg"  rel="lightbox"><img title="Contoso_Preview" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="464" alt="Contoso_Preview" src="http://www.devexpertise.com/wp-content/uploads/2009/03/contoso-preview-thumb.jpg" width="720" border="0" /></a></p>
<p><strong><em>Corporate</em>:</strong></p>
<p><a href="http://www.devexpertise.com/wp-content/uploads/2009/03/corporate-preview.jpg"  rel="lightbox"><img title="Corporate_Preview" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="541" alt="Corporate_Preview" src="http://www.devexpertise.com/wp-content/uploads/2009/03/corporate-preview-thumb.jpg" width="720" border="0" /></a></p>
<p><strong><em>Events</em>:</strong></p>
<p><a href="http://www.devexpertise.com/wp-content/uploads/2009/03/events-preview.jpg"  rel="lightbox"><img title="Events_Preview" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="613" alt="Events_Preview" src="http://www.devexpertise.com/wp-content/uploads/2009/03/events-preview-thumb.jpg" width="720" border="0" /></a></p>
<p><strong><em>OARP</em></strong>:</p>
<p><a href="http://www.devexpertise.com/wp-content/uploads/2009/03/oarp-preview.jpg"  rel="lightbox"><img title="OARP_Preview" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="608" alt="OARP_Preview" src="http://www.devexpertise.com/wp-content/uploads/2009/03/oarp-preview-thumb.jpg" width="720" border="0" /></a></p>
<p><strong><em>Procurement:</em></strong></p>
<p><a href="http://www.devexpertise.com/wp-content/uploads/2009/03/procurement-preview.jpg"  rel="lightbox"><img title="Procurement_Preview" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="621" alt="Procurement_Preview" src="http://www.devexpertise.com/wp-content/uploads/2009/03/procurement-preview-thumb.jpg" width="720" border="0" /></a></p>
<p><strong><em>Publishing:</em></strong>&#160;</p>
<p><a href="http://www.devexpertise.com/wp-content/uploads/2009/03/publishing-preview.jpg"  rel="lightbox"><img title="Publishing_Preview" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="608" alt="Publishing_Preview" src="http://www.devexpertise.com/wp-content/uploads/2009/03/publishing-preview-thumb.jpg" width="720" border="0" /></a></p>
<p><strong><em>Sporting:</em></strong></p>
<p><a href="http://www.devexpertise.com/wp-content/uploads/2009/03/sporting-preview.jpg"  rel="lightbox"><img title="sporting_Preview" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="623" alt="sporting_Preview" src="http://www.devexpertise.com/wp-content/uploads/2009/03/sporting-preview-thumb.jpg" width="720" border="0" /></a></p>
<p><strong><em>Startup:</em></strong></p>
<p><a href="http://www.devexpertise.com/wp-content/uploads/2009/03/startup-preview.jpg"  rel="lightbox"><img title="Start-Up_Preview" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="608" alt="Start-Up_Preview" src="http://www.devexpertise.com/wp-content/uploads/2009/03/startup-preview-thumb.jpg" width="720" border="0" /></a></p>
<p><strong><em>Team:</em></strong></p>
<p><a href="http://www.devexpertise.com/wp-content/uploads/2009/03/team-preview.jpg"  rel="lightbox"><img title="Team_Preview" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="588" alt="Team_Preview" src="http://www.devexpertise.com/wp-content/uploads/2009/03/team-preview-thumb.jpg" width="720" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.devexpertise.com/2009/03/20/ten-free-sharepoint-themes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing a Theme as a SharePoint Feature</title>
		<link>http://www.devexpertise.com/2009/02/11/installing-a-theme-as-a-sharepoint-feature/</link>
		<comments>http://www.devexpertise.com/2009/02/11/installing-a-theme-as-a-sharepoint-feature/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 13:48:53 +0000</pubDate>
		<dc:creator>DevExpert</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint UI]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[Themes]]></category>

		<guid isPermaLink="false">http://www.devexpertise.com/2009/02/11/installing-a-theme-as-a-sharepoint-feature/</guid>
		<description><![CDATA[I briefly went over my approach to creating a custom SharePoint theme in my previous post, and I even included a downloadable solution package that you can install on your farm (provided you have the .NET 3.5 Framework installed).&#160; How did I accomplish this?&#160; Pretty easily actually.&#160; Unfortunately there isn’t much documentation or examples of [...]]]></description>
			<content:encoded><![CDATA[<p>I briefly went over my approach to creating a custom SharePoint theme in my <a href="http://www.devexpertise.com/2009/02/09/creating-a-custom-vista-theme-for-sharepoint/"  target="_blank">previous post</a>, and I even included a downloadable solution package that you can install on your farm (provided you have the .NET 3.5 Framework installed).&#160; How did I accomplish this?&#160; Pretty easily actually.&#160; Unfortunately there isn’t much documentation or examples of this out there, so allow me to put an end to that!</p>
<p>SharePoint features and solutions are absolutely essential if you want to provide an easy and maintainable method of deploying custom artifacts to your SharePoint servers.&#160; A theme is a perfect candidate for this, as everything is file-system based and located with the 12 directory.&#160; The only odd thing that throws a monkey wrench in this seemingly simple process is the SPTHEMES.XML file, which must be updated to include an entry for your custom theme.&#160; Here’s a portion of that file, with the custom theme I developed in my previous post highlighted:</p>
<p><a href="http://www.devexpertise.com/wp-content/uploads/2009/02/image43.png" ><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.devexpertise.com/wp-content/uploads/2009/02/image-thumb41.png" width="653" height="357" /></a></p>
<p>Now, you could by all means include the SPTHEMES.XML file in your solution and have it overwrite the existing file, but what if you have other themes defined in your file?&#160; That approach will overwrite it, and you’ll have to reenter everything.&#160; The recommended approach to this is to create a feature receiver that fires when the feature is installed and modifies the SPTHEMES.XML.&#160; When the feature is installed, a custom &lt;Templates&gt; section is added for the custom theme, and when it’s uninstalled it’s removed.</p>
<blockquote><p>NOTE: A feature is “installed” when you run the <strong>STSADM –o installfeature</strong> command, or when a feature is contained in a solution package and that solution package is <em>deployed</em>.</p>
</blockquote>
<p>One important thing to mention is that this feature is scoped for the farm, not an individual site-collection or site, as the files deployed to the file system are used by the entire farm.&#160; Let’s first take a look at the feature.xml file:</p>
<div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; max-height: 1200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot; <span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Feature </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/sharepoint/</span>&quot;
         <span style="color: red">Id</span><span style="color: blue">=</span>&quot;<span style="color: blue">2D965A22-73A9-4e00-A530-06F2AF6EC89F</span>&quot;
         <span style="color: red">Title</span><span style="color: blue">=</span>&quot;<span style="color: blue">DevExpertise Vista Theme</span>&quot;
         <span style="color: red">Description</span><span style="color: blue">=</span>&quot;<span style="color: blue">Adds the DevExpertise Vista Theme</span>&quot;
         <span style="color: red">Scope</span><span style="color: blue">=</span>&quot;<span style="color: blue">Farm</span>&quot;
         <span style="color: red">Version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0.0.0</span>&quot;
         <span style="color: red">ImageUrl</span><span style="color: blue">=</span>&quot;<span style="color: blue">DevExpertise\devexpertiseLogo.png</span>&quot;
         <span style="color: red">ReceiverAssembly</span><span style="color: blue">=</span>&quot;<span style="color: blue">DevExpertise.SharePoint.Themes, Version=1.0.0.0,
                           Culture=neutral, PublicKeyToken=d39eedb6cff9b1c8</span>&quot;
         <span style="color: red">ReceiverClass </span><span style="color: blue">=</span>&quot;<span style="color: blue">DevExpertise.SharePoint.Themes.FeatureReceiver</span>&quot;<span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">Feature</span><span style="color: blue">&gt;</span></pre>
</div>
<p>As you can see, it is executing a custom FeatureReceiver class.&#160; At a high-level, the receiver looks like this:</p>
<p><strong><font color="#ff0000">[UPDATED 5/27/2009]<br />
      <br />I received a couple comments that let me know that if this feature is activated on a farm with multiple front-ends, then the <em>FeatureActivated</em> event only gets fired on a single web front-end.&#160; This is absolutely TRUE, and an oversight on my part (thanks guys!).&#160; The solution is extremely simple – put your code in the <em>FeatureInstalled</em> and <em>FeatureUninstalling</em> events instead, as these get fired on EVERY web front-end in your farm!!&#160; I’ve modified the code to reflect this:</font></strong></p>
<div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; max-height: 1200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
<pre class="code"><span style="color: blue">public class </span><span style="color: #2b91af">FeatureReceiver</span>: <span style="color: #2b91af">SPFeatureReceiver </span>{

    <span style="color: blue">private enum </span><span style="color: #2b91af">ModificationType </span>{ Add, Remove }

    <span style="color: blue">public override void </span>FeatureInstalled(<span style="color: #2b91af">SPFeatureReceiverProperties </span>properties) {
        ModifySPTheme(<span style="color: #2b91af">ModificationType</span>.Add);

        <span style="color: green">// if necessary, loop through all sites and set theme
    </span>}

    <span style="color: blue">public override void </span>FeatureUninstalling(<span style="color: #2b91af">SPFeatureReceiverProperties </span>properties) {
        ModifySPTheme(<span style="color: #2b91af">ModificationType</span>.Remove);

        <span style="color: green">// if necessary, loop through all sites and reset theme
    </span>}

    <span style="color: blue">public override void </span>FeatureActivated(<span style="color: #2b91af">SPFeatureReceiverProperties </span>properties) {
        <span style="color: green">// do nothing
    </span>}

    <span style="color: blue">public override void </span>FeatureDeactivating(<span style="color: #2b91af">SPFeatureReceiverProperties </span>properties) {
        <span style="color: green">// do nothing
    </span>}
}</pre>
</div>
<p>For the sake of simplicity, I’m not including code to set the theme on any sites.&#160; Since this is a farm feature, it doesn’t make sense to set the theme for a particular site here, but by all means if you wanted to you could.&#160; Basically this feature receiver is only for modifying the SPTHEMES.XML file.</p>
<p>Let’s take a look at the ModifySPTheme() method.&#160; It uses LINQ to XML to open and parse the file, add the necessary elements when the feature is installed, and remove it when the feature is uninstalling:</p>
<div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; max-height: 2200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
<pre class="code"><span style="color: blue">private void </span>ModifySPTheme(<span style="color: #2b91af">ModificationType </span>type) {
    <span style="color: #2b91af">XDocument </span>doc = <span style="color: blue">null</span>;
    <span style="color: #2b91af">XNamespace </span>ns = <span style="color: #a31515">&quot;http://tempuri.org/SPThemes.xsd&quot;</span>;

    <span style="color: green">// path to the SPTHEMES.XML file
    </span><span style="color: blue">string </span>spthemePath = <span style="color: #2b91af">Path</span>.Combine(<span style="color: #2b91af">SPUtility</span>.GetGenericSetupPath(<span style="color: #a31515">@&quot;TEMPLATE\LAYOUTS\1033&quot;</span>), <span style="color: #a31515">&quot;SPTHEMES.XML&quot;</span>);
    <span style="color: blue">string </span>contents = <span style="color: blue">string</span>.Empty;

    <span style="color: green">// read the contents of the SPTHEMES.XML file
    </span><span style="color: blue">using </span>(<span style="color: #2b91af">StreamReader </span>streamReader = <span style="color: blue">new </span><span style="color: #2b91af">StreamReader</span>(spthemePath)) {
        contents = streamReader.ReadToEnd();
        streamReader.Close();
    }

    <span style="color: blue">using </span>(<span style="color: #2b91af">StringReader </span>stringReader = <span style="color: blue">new </span><span style="color: #2b91af">StringReader</span>(contents.Trim())) {
        <span style="color: green">// create a new XDocument from the contents of the file
        </span>doc = <span style="color: #2b91af">XDocument</span>.Load(stringReader);

        <span style="color: green">// retrieve all elements with a TemplateID of 'VISTA'.  At most, there should only be one
        </span><span style="color: blue">var </span>element = <span style="color: blue">from </span>b <span style="color: blue">in </span>doc.Element(ns + <span style="color: #a31515">&quot;SPThemes&quot;</span>).Elements(ns + <span style="color: #a31515">&quot;Templates&quot;</span>)
                      <span style="color: blue">where </span>b.Element(ns + <span style="color: #a31515">&quot;TemplateID&quot;</span>).Value == <span style="color: #a31515">&quot;VISTA&quot;
                      </span><span style="color: blue">select </span>b;

        <span style="color: green">// determine if the VISTA theme element already exists
        </span><span style="color: blue">bool </span>exists = (element != <span style="color: blue">null </span>&amp;&amp; element.Count() &gt; 0);

        <span style="color: blue">if </span>(type == <span style="color: #2b91af">ModificationType</span>.Add) {
            <span style="color: blue">if </span>(!exists) {
                <span style="color: green">// create an XElement that defines our custom VISTA theme
                </span><span style="color: #2b91af">XElement </span>xml =
                    <span style="color: blue">new </span><span style="color: #2b91af">XElement</span>(ns + <span style="color: #a31515">&quot;Templates&quot;</span>,
                        <span style="color: blue">new </span><span style="color: #2b91af">XElement</span>(ns + <span style="color: #a31515">&quot;TemplateID&quot;</span>, <span style="color: #a31515">&quot;VISTA&quot;</span>),
                        <span style="color: blue">new </span><span style="color: #2b91af">XElement</span>(ns + <span style="color: #a31515">&quot;DisplayName&quot;</span>, <span style="color: #a31515">&quot;DevExpertise Vista Theme&quot;</span>),
                        <span style="color: blue">new </span><span style="color: #2b91af">XElement</span>(ns + <span style="color: #a31515">&quot;Description&quot;</span>, <span style="color: #a31515">&quot;A Vista-like Theme&quot;</span>),
                        <span style="color: blue">new </span><span style="color: #2b91af">XElement</span>(ns + <span style="color: #a31515">&quot;Thumbnail&quot;</span>, <span style="color: #a31515">&quot;images/DevExpertise.SharePoint.Themes/VISTA/thVISTA.gif&quot;</span>),
                        <span style="color: blue">new </span><span style="color: #2b91af">XElement</span>(ns + <span style="color: #a31515">&quot;Preview&quot;</span>, <span style="color: #a31515">&quot;images/DevExpertise.SharePoint.Themes/VISTA/thVISTA.gif&quot;</span>));

                <span style="color: green">// add the element to the file and save
                </span>doc.Element(ns + <span style="color: #a31515">&quot;SPThemes&quot;</span>).Add(xml);
                doc.Save(spthemePath);
            }
        }
        <span style="color: blue">else </span>{
            <span style="color: blue">if </span>(exists) {
                <span style="color: green">// if the element exists, remove it and save
                </span>element.Remove();
                doc.Save(spthemePath);
            }
        }

        stringReader.Close();
    }
}</pre>
</div>
<p>Pretty slick, huh? Now, keep in mind that this only modifies the SPTHEMES.XML file – it does NOT set the theme for any site.&#160; It will still be up to the user or site admins to set the theme for a given site.&#160; Also, if this theme is already applied to a site and the feature is deactivated, it won’t reset the theme – it will only remove the entry from the theme settings page in Site Settings.&#160; Finally, if a site has this theme installed and the solution package is uninstalled and/or removed, your site’s theme will be messed up because the source files are gone.&#160; It is probably beneficial to at least loop through all the sites and reset the theme to something else if and when the feature is deactivated, but I’ll leave that to you. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devexpertise.com/2009/02/11/installing-a-theme-as-a-sharepoint-feature/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Creating a Custom Vista Theme for SharePoint</title>
		<link>http://www.devexpertise.com/2009/02/09/creating-a-custom-vista-theme-for-sharepoint/</link>
		<comments>http://www.devexpertise.com/2009/02/09/creating-a-custom-vista-theme-for-sharepoint/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 01:01:51 +0000</pubDate>
		<dc:creator>DevExpert</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint UI]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Web Parts]]></category>

		<guid isPermaLink="false">http://www.devexpertise.com/2009/02/09/creating-a-custom-vista-theme-for-sharepoint/</guid>
		<description><![CDATA[There are plenty of resources for learning how to create themes for SharePoint.&#160; A theme is a pre-packaged set of styles and images that make your SharePoint site look a little less…well…”SharePoint-y”.&#160; Themes are limited in the respect that they don’t really modify the layout and positioning of your pages, but rather change the colors [...]]]></description>
			<content:encoded><![CDATA[<p>There are plenty of resources for learning how to create themes for SharePoint.&#160; A theme is a pre-packaged set of styles and images that make your SharePoint site look a little less…well…”SharePoint-y”.&#160; Themes are limited in the respect that they don’t really modify the layout and positioning of your pages, but rather change the colors and background images applied to elements.&#160; You can still get pretty fancy with just a theme, but recognize that it’s not enough to completely eliminate the default look and feel.</p>
<p>That said, let’s take a look at theme I put together for the purposes of this blog.&#160; It is loosely based on Vista’s black and aqua stylings, and is aptly named “Vista Theme”.&#160; Before I get into the details about how I approach theme development (since it’s probably not the way you’re used to), let’s take a look at some screenshots of what the finished theme looks like.&#160; In addition, I’m feeling extra generous today and have provided my completed theme for your enjoyment <img src='http://www.devexpertise.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><em>Home Page:      <br /></em><a href="http://www.devexpertise.com/wp-content/uploads/2009/02/image30.png" ><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="505" alt="image" src="http://www.devexpertise.com/wp-content/uploads/2009/02/image-thumb28.png" width="720" border="0" /></a> </p>
<p><em>Calendar:</em>     <br /><a href="http://www.devexpertise.com/wp-content/uploads/2009/02/image31.png" ><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="524" alt="image" src="http://www.devexpertise.com/wp-content/uploads/2009/02/image-thumb29.png" width="720" border="0" /></a></p>
<p><em>Reports Subsite:      <br /></em><a href="http://www.devexpertise.com/wp-content/uploads/2009/02/image32.png" ><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="504" alt="image" src="http://www.devexpertise.com/wp-content/uploads/2009/02/image-thumb30.png" width="720" border="0" /></a> </p>
<p><em>Document Library:      <br /></em><a href="http://www.devexpertise.com/wp-content/uploads/2009/02/image33.png" ><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="402" alt="image" src="http://www.devexpertise.com/wp-content/uploads/2009/02/image-thumb31.png" width="720" border="0" /></a> </p>
<p><em>Search Center:      <br /></em><a href="http://www.devexpertise.com/wp-content/uploads/2009/02/image34.png" ><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="402" alt="image" src="http://www.devexpertise.com/wp-content/uploads/2009/02/image-thumb32.png" width="720" border="0" /></a> </p>
<p><em>Site Actions Menu:      <br /></em><a href="http://www.devexpertise.com/wp-content/uploads/2009/02/image35.png" ><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="315" alt="image" src="http://www.devexpertise.com/wp-content/uploads/2009/02/image-thumb33.png" width="252" border="0" /></a> </p>
<p><strong>Theme Development</strong>&#160; <br />Ok…now that I’ve [hopefully] gotten your attention, let me discuss what it took to develop this theme.&#160; As you probably know, themes are stored in the following SharePoint directory:</p>
<blockquote><p>C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES\</p>
</blockquote>
<p>In here you’ll find all of the themes that ship with SharePoint out of the box, including GRANITE, SIMPLE, JET, etc..&#160; To create your own theme, the easiest way is to start with a theme you like, copy the folder, and rename it something unique.&#160; In my case, I named it VISTA.&#160; Once you have created your custom folder, it’s imperative you locate the .INF file inside your theme folder, and rename to the name of the folder.&#160; Again, in my case, VISTA.INF.&#160; Next, open it up and change every occurrence of the previous theme’s name, and update it with the name of yours:</p>
<p><a href="http://www.devexpertise.com/wp-content/uploads/2009/02/image36.png" ><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="520" alt="image" src="http://www.devexpertise.com/wp-content/uploads/2009/02/image-thumb34.png" width="238" border="0" /></a> </p>
<p>The next part is a little unorthodox, and I originally saw this <a href="http://www.heathersolomon.com/blog/archive/2008/01/30/SharePoint-2007-Design-Tip-Import-your-CSS-for-SharePoint-Themes.aspx" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.heathersolomon.com');" target="_blank">approach described</a> by <a href="http://www.heathersolomon.com/Blog/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.heathersolomon.com');" target="_blank">Heather Solomon</a>, and it has proven extremely useful and efficient.&#160; The idea is to separate the actual theme artifact files (CSS and images) from the theme definition.&#160; The theme definition, which includes every file in the theme folder, is cached whenever the theme is applied to the site.&#160; This means that the only way you can make changes and see them appear is by updating the files in the file system, setting the site’s theme to another theme other than your own, and finally applying your theme again.&#160; Trust me, this is nowhere near ideal when it comes to CSS, as I guarantee you’ll have to try something, test, try something, test, and so on.&#160; The other option is to use SharePoint Designer and modify the cached files, in which case you must remember to update the actual file system files before it gets cached again. The beauty of Heather’s approach is that a single CSS file is cached, and the only thing it contains is a link to a file and the images on the file system in another location which <em>aren’t</em> cached.&#160; This will allow you to make changes directly to the files on the file system and immediately see your changes.</p>
<p>Here is the structure of my Visual Studio solution.&#160; NOTE: The VISTA folder is collapsed due to space, but inside it are all of my images and style sheets:</p>
<p><a href="http://www.devexpertise.com/wp-content/uploads/2009/02/image37.png" ><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="305" alt="image" src="http://www.devexpertise.com/wp-content/uploads/2009/02/image-thumb35.png" width="335" border="0" /></a> </p>
<p>The next steps are typical – create an entry in the SPTHEMES.XML file that identifies your theme, reset IIS or recycle the application pool, and apply your theme.&#160; If all was successful, you should see the following in your site’s theme settings page:</p>
<p><a href="http://www.devexpertise.com/wp-content/uploads/2009/02/image38.png" ><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="273" alt="image" src="http://www.devexpertise.com/wp-content/uploads/2009/02/image-thumb36.png" width="720" border="0" /></a> </p>
<p>One thing I would like to explicitly explain – how to create custom web part headers.&#160; If you pay close attention to the above screenshots, you’ll notice all of my web parts look like this:     <br /><a href="http://www.devexpertise.com/wp-content/uploads/2009/02/image39.png" ><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="128" alt="image" src="http://www.devexpertise.com/wp-content/uploads/2009/02/image-thumb37.png" width="561" border="0" /></a></p>
<p>This is achieve relatively easily as long as you can create decent-looking header images with your editor of choice (mine is Photoshop).&#160; Basically you need 3 images: a background, a left side, and a right side. Zoomed in, my custom images look like the following:</p>
<p><strong>wp-header-bg.gif:</strong>     <br /><a href="http://www.devexpertise.com/wp-content/uploads/2009/02/image40.png" ><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="240" alt="image" src="http://www.devexpertise.com/wp-content/uploads/2009/02/image-thumb38.png" width="108" border="0" /></a> </p>
<p><strong>wp-header-right.gif</strong>     <br /><a href="http://www.devexpertise.com/wp-content/uploads/2009/02/image41.png" ><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="240" alt="image" src="http://www.devexpertise.com/wp-content/uploads/2009/02/image-thumb39.png" width="108" border="0" /></a> </p>
<p><strong>wp-header-left.gif</strong>     <br /><a href="http://www.devexpertise.com/wp-content/uploads/2009/02/image42.png" ><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="240" alt="image" src="http://www.devexpertise.com/wp-content/uploads/2009/02/image-thumb40.png" width="108" border="0" /></a></p>
<p>The CSS styles are fairly simple:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 1200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<pre class="code"><span style="color: green">/* Web Part Header Styles */
</span><span style="color: #a31515">h3.ms-WPTitle </span>{
    <span style="color: red">background</span>: <span style="color: blue">url('wp-header-left.gif') top left no-repeat</span>;
    <span style="color: red">font-size</span>: <span style="color: blue">8pt</span>;
    <span style="color: red">padding</span>: <span style="color: blue">3px 0px 4px 6px</span>; }    

<span style="color: #a31515">h3.ms-WPTitle</span>, <span style="color: #a31515">h3.ms-WPTitle a</span>, <span style="color: #a31515">h3.ms-WPTitle a:link</span>,
<span style="color: #a31515">h3.ms-WPTitle a:hover</span>, <span style="color: #a31515">h3.ms-WPTitle a:visited</span>{
    <span style="color: red">color</span>:<span style="color: blue">#181818</span>;}    

<span style="color: #a31515">.ms-WPHeader TD </span>{
    <span style="color: red">border-bottom</span>:<span style="color: blue">1px #297c95 solid</span>;
    <span style="color: red">background</span>: <span style="color: blue">url('wp-header-bg.gif') top left repeat-x</span>;
    <span style="color: red">padding-right</span>: <span style="color: blue">0 !important</span>; }        

<span style="color: #a31515">.ms-WPHeader .ms-HoverCellInActive</span>, <span style="color: #a31515">.ms-WPHeader .ms-HoverCellActiveDark </span>{
    <span style="color: red">background</span>: <span style="color: blue">url('wp-header-right.gif')  no-repeat right 0px</span>;
    <span style="color: red">margin-top</span>:<span style="color: blue">0px</span>;
    <span style="color: red">margin-right</span>:<span style="color: blue">0px</span>; }

<span style="color: #a31515">H3.ms-standardheader SPAN </span>{
    <span style="color: red">color</span>: <span style="color: blue">#181818</span>;}

<span style="color: green">/* Web Part Header Hover Image Styles */
</span><span style="color: #a31515">.ms-HoverCellInActive</span>, <span style="color: #a31515">.ms-SpLinkButtonInActive</span>{
    <span style="color: red">padding-right</span>:<span style="color: blue">5px</span>;
    <span style="color: red">padding-top</span>:<span style="color: blue">2px</span>;
    <span style="color: red">margin-bottom</span>:<span style="color: blue">0px</span>; }

<span style="color: #a31515">.ms-HoverCellActiveDark</span>{
    <span style="color: red">border</span>:<span style="color: blue">none</span>;
    <span style="color: red">padding-right</span>:<span style="color: blue">4px</span>;
    <span style="color: red">padding-top</span>:<span style="color: blue">2px</span>; }

<span style="color: #a31515">.ms-HoverCellActiveDark img</span>{
    <span style="color: red">border</span>:<span style="color: blue">1px black solid</span>;
    <span style="color: red">background</span>: <span style="color: blue">#5E5E5E</span>;}     </pre>
</div>
<p>
  <br />The only drawback to including these styles in a theme is these are applied to each and every web part in your site. It may not be appropriate to style all of the web parts, but rather web parts on a single page.&#160; If you only want web parts on a single page to be styled, then you could add the CSS classes to a Content Editor Web Part, or link to the style sheet on the page’s page layout.&#160; The important thing to note is that all web parts on a single page will by styled the same.&#160; There’s no easy way to apply a style to one web part and not the other.&#160; For simplicity sake, I’ve just included these styles in my theme.</p>
<p>You can download this theme and install it via the following farm-scoped feature.&#160; NOTE:&#160; The feature receiver I’m using relies on classes from the .NET 3.5 Framework (you’ll see why in my next post), but this will fail if you try to install it on a farm that doesn’t have 3.5.&#160; If you’re just interested in the source files and style sheets, change the .WSP extension to .CAB and extract the stuff you want.&#160; As I mentioned, I will be explaining how to install a theme via a feature in my next post.&#160; Stay tuned!<br />
  </p>
</p>
<p>&#160;</p>
<div class="wlWriterEditableSmartContent" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:4c55d70e-29b1-48cd-ae79-96c759a0c371" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<p>Download: <a href="http://www.devexpertise.com/wp-content/uploads/2009/02/devexpertisesharepointthemes1.zip" onclick="javascript:pageTracker._trackPageview('/downloads/wp-content/uploads/2009/02/devexpertisesharepointthemes1.zip');" target="_blank">DevExpertise.SharePoint.Themes</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.devexpertise.com/2009/02/09/creating-a-custom-vista-theme-for-sharepoint/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
