<?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>Buta no Ie &#187; collaboration</title>
	<atom:link href="http://singchan.com/tag/collaboration/feed/" rel="self" type="application/rss+xml" />
	<link>http://singchan.com</link>
	<description>The House of Pork and User Experience Development</description>
	<lastBuildDate>Tue, 11 Oct 2011 22:08:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Branding SharePoint 2010 Collaboration Sites &#8211; Part 3 in a Series</title>
		<link>http://singchan.com/2010/02/23/branding-sharepoint-2010-collaboration-sites-part-3-in-a-series/</link>
		<comments>http://singchan.com/2010/02/23/branding-sharepoint-2010-collaboration-sites-part-3-in-a-series/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 16:04:48 +0000</pubDate>
		<dc:creator>Buta</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[collaboration]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[DelegateControl]]></category>
		<category><![CDATA[master page]]></category>
		<category><![CDATA[SPC09]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[theming system]]></category>
		<category><![CDATA[ue]]></category>
		<category><![CDATA[user experience]]></category>

		<guid isPermaLink="false">http://singchan.com/?p=181</guid>
		<description><![CDATA[In part two, we posted about how to register our custom style sheets in a way that we could still take advantage of the new SharePoint 2010 colour switching theming engine. In this post we&#8217;ll go through how to do this without having to modify the out-of-the-box master pages or having to use custom master [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://singchan.com/2009/12/29/branding-sharepoint-2010-collaboration-sites-part-2-in-a-series/" title="Branding SharePoint 2010 Collaboration Sites - Part 2 in a Series">part two</a>, we posted about how to register our custom style sheets in a way that we could still take advantage of the new SharePoint 2010 colour switching theming engine. In this post we&#8217;ll go through how to do this without having to modify the out-of-the-box master pages or having to use custom master pages for your sites.</p>
<h3>Delegate Controls</h3>
<p>As I mentioned at the end of part two, the way we&#8217;re going to get our CSS added to our sites and pages is through the use of a <strong>delegate control</strong>. For those of you who aren&#8217;t familiar with delegate controls, they are essentially placeholders for you to inject your own controls via a feature. Your feature can be scoped to either <em>Web</em>, <em>Site</em>, <em>WebApplication</em> or <em>Farm</em>. I&#8217;m going to keep the explanation on delegate controls short as there&#8217;s plenty of information out there about them:</p>
<ul>
<li><a href="http://www.sharepointnutsandbolts.com/2007/06/using-delegate-control.html">Chris O&#8217;Brien: Using the Delegate Control</a></li>
<li><a href="http://www.devx.com/enterprise/Article/36628/1954">SharePoint&#8217;s Delegate Control Power</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.delegatecontrol%28office.14%29.aspx">MSDN 2010 SDK: DelegateControl Class</a></li>
</ul>
<div id="attachment_204" class="wp-caption alignright" style="width: 160px"><a href="http://singchan.com/wordpress/wp-content/uploads/2010/02/AdditionalPageHead.png" rel="lightbox[181]" title="AdditionalPageHead Delegate Control"><img src="http://singchan.com/wordpress/wp-content/uploads/2010/02/AdditionalPageHead-150x150.png" alt="Screenshot of AdditionalPageHead delegate control in v4.master" title="AdditionalPageHead Delegate Control" width="150" height="150" class="size-thumbnail wp-image-204" /></a><p class="wp-caption-text">AdditionalPageHead Delegate Control</p></div>
<h3>The AdditionalPageHead Delegate</h3>
<p>Delegate controls have a <strong>AllowMultipleControls</strong> property which when set to <em>true</em>, all controls keyed to that delegate are added to the page; when set to <em>false</em>, only the control registered with the lowest <em>sequence</em> value is added to the page.</p>
<p>All of the delegate controls in the OOTB master pages have <strong>AllowMultipleControls</strong> set to <em>false</em>, with the exception of one, <strong>AdditionalPageHead</strong>, which does allow multiple controls. And guess what? AdditionalPageHead is actually located in the page head, where you would normally add CSS
<link> elements! This is the perfect place for us to inject any CSS registration controls.</p>
<h3>Putting it all together&#8230;</h3>
<p>Let&#8217;s put together a simple solution using the Visual Studio 2010 SharePoint Tools which will:</p>
<ol>
<li>deploy our CSS file in the <strong>Themable</strong> folder in the <em>/Layouts/1033/Styles</em></li>
<li>deploy a user control into the <em>ControlTemplates</em> folder which uses the <strong>CSSRegistration</strong> control to register our CSS</li>
<li>install a feature which inserts our user control onto our pages via the <strong>AdditionalPageHead</strong> delegate</li>
</ol>
<h4>The CSS</h4>
<p>Keeping it simple, all our CSS does is set the background color of the &lt;body&gt;. We&#8217;ll use #FFF (white) as our default background color and also decorate the rule with one of the SharePoint 2010 compile time directives to whatever we might set the &#8220;Light1&#8243; color value as through the Theme UI.</p>
<pre class="brush: plain; title: ; notranslate">
body {
/*[ReplaceColor(themeColor:&quot;Light1&quot;)]*/
background-color: #fff;
}
</pre>
<h4>The Delegate Control</h4>
<p>Again, nice and simple, we&#8217;re going to use the CSSRegistration control to register our branding CSS after corev4.css:</p>
<pre class="brush: plain; title: ; notranslate">
&lt;%@ Assembly Name=&quot;$SharePoint.Project.AssemblyFullName$&quot; %&gt;
&lt;%@ Register Tagprefix=&quot;SharePoint&quot; Namespace=&quot;Microsoft.SharePoint.WebControls&quot; Assembly=&quot;Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot; %&gt;

&lt;sharepoint :CSSRegistration Name=&quot;&lt;% $SPUrl:~sitecollection/_layouts/1033/Styles/Themable/SingChan.SP2010.Branding/branding.css %&gt;&quot; After=&quot;corev4.css&quot; runat=&quot;server&quot; /&gt;
&lt;/sharepoint&gt;
</pre>
<h4>Element Manifest</h4>
<p>And finally we&#8217;ll define our element manifest for our delegate feature:</p>
<pre class="brush: plain; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;elements xmlns=&quot;http://schemas.microsoft.com/sharepoint/&quot;&gt;
    &lt;control Id=&quot;AdditionalPageHead&quot; Sequence=&quot;80&quot; ControlSrc=&quot;~/_ControlTemplates/SingChan.SP2010.Branding/CSSRegistrationControl.ascx&quot; /&gt;
&lt;/elements&gt;
</pre>
<p>You&#8217;ll most likely scope your delegate feature to either <em>Web</em> or <em>Site</em> for branding purposes. I tend to scope my feature at the site collection level to achieve a consistent brand across all the webs in the site collection. If there&#8217;s a requirement to have different branding for one or two specific sites, then we can always have a second feature which deploys those overrides at a web-level scope. If you have vastly different brands across webs in your site collection, then you may want to scope only at the web level so that your brands don&#8217;t conflict or end up with any style inheritance issues.</p>
<h3>That&#8217;s it!</h3>
<p>If all went well, we should see the link to our style sheet emitted after the link to corev4.css!<br />
<div id="attachment_210" class="wp-caption aligncenter" style="width: 160px"><a href="http://singchan.com/wordpress/wp-content/uploads/2010/02/brandingcss.png" rel="lightbox[181]" title="Branding CSS in HTML Source"><img src="http://singchan.com/wordpress/wp-content/uploads/2010/02/brandingcss-150x150.png" alt="Screen shot of HTML source of page containing a link to the branding CSS." title="Branding CSS in HTML Source" width="150" height="150" class="size-thumbnail wp-image-210" /></a><p class="wp-caption-text">Our branding CSS being emitted in HTML</p></div></link>
<p>If all is not well, here&#8217;s the ZIP file containing the branding VS2010 solution for reference:<br />
<a href='http://singchan.com/wordpress/wp-content/uploads/2010/02/SingChan.SP2010.Branding.zip' title="ZIP file containing the branding VS2010 solution">SingChan.SP2010.Branding.zip</a></p>
<h3>Previously&#8230;</h3>
<ul>
<li><a title="Branding SharePoint 2010 Collaboration Sites: Part 1" href="/2009/12/23/branding-sharepoint-2010-collaboration-sites-part-1-in-a-series/">You can find Part One here!</a></li>
<li><a title="Branding SharePoint 2010 Collaboration Sites: Part 2" href="/2009/12/29/branding-sharepoint-2010-collaboration-sites-part-2-in-a-series/">You can find Part Two here!</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://singchan.com/2010/02/23/branding-sharepoint-2010-collaboration-sites-part-3-in-a-series/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Branding SharePoint 2010 Collaboration Sites &#8211; Part 2 in a Series</title>
		<link>http://singchan.com/2009/12/29/branding-sharepoint-2010-collaboration-sites-part-2-in-a-series/</link>
		<comments>http://singchan.com/2009/12/29/branding-sharepoint-2010-collaboration-sites-part-2-in-a-series/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 00:15:45 +0000</pubDate>
		<dc:creator>Buta</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[branding]]></category>
		<category><![CDATA[collaboration]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSSLink]]></category>
		<category><![CDATA[CSSRegistration]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[theming system]]></category>
		<category><![CDATA[ThmxTheme]]></category>
		<category><![CDATA[ue]]></category>
		<category><![CDATA[user experience]]></category>

		<guid isPermaLink="false">http://singchan.com/?p=141</guid>
		<description><![CDATA[In part one of this series on branding SharePoint 2010 collaboration sites I posted a bit about how the new Theming engine works in SharePoint 2010. In this post, we&#8217;ll be going over the new and improved CSSRegistration control in SharePoint 2010. A history lesson; the CSSRegistration control in SharePoint 2007 The CSSRegistration control in [...]]]></description>
			<content:encoded><![CDATA[<p>In <a title="Branding SharePoint 2010 Collaboration Sites - Part One" href="http://singchan.com/2009/12/23/branding-sharepoint-2010-collaboration-sites-part-1-in-a-series/">part one</a> of this series on branding SharePoint 2010 collaboration sites I posted a bit about how the new Theming engine works in SharePoint 2010. In this post, we&#8217;ll be going over the new and improved <strong>CSSRegistration</strong> control in SharePoint 2010.</p>
<h3>A history lesson; the CSSRegistration control in SharePoint 2007</h3>
<p>The CSSRegistration control in SharePoint 2007 basically has one property you can set, the <strong>Name</strong> is the Url to the CSS file that you want to register. When you register a style sheet through the control, it adds the CSS file to an <em>alphabetically sorted</em> list<em>.</em> The style sheets in this list are then emitted as HTML &lt;link&gt; elements by the <strong>CSSLink</strong> control.</p>
<p>If you required one CSS file to be emitted before another, you would need to name them accordingly. For example:</p>
<pre class="brush: plain; title: ; notranslate">&lt;SharePoint:CSSRegistration Name=&quot;foo.css&quot; runat=&quot;server&quot; /&gt;
&lt;SharePoint:CSSRegistration Name=&quot;bar.css&quot; runat=&quot;server&quot; /&gt;</pre>
<p>Even though I registered <em>foo.css</em> before <em>bar.css</em>, the HTML on the rendered page would look like so:</p>
<pre class="brush: plain; title: ; notranslate">&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;bar.css&quot;/&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;foo.css&quot;/&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/_layouts/1033/styles/core.css?rev=...&quot;/&gt;</pre>
<p><em>bar.css</em> would come before <em>foo.css</em> and what&#8217;s this <em>core.css</em> doing here? Somehow, someone at MS decided that the core.css containing ALL of the base CSS rules for WSS should override any custom CSS!</p>
<p>As a workaround, you could set the <strong>DefaultUrl</strong> property for the CSSLink control to point to a single CSS file that would come after core.css, and then use @import to link to any additional custom CSS files.</p>
<p>The fact that core.css was emitted after any style sheets registered using CSSRegistration made the CSSRegistration control all but useless in 2007.</p>
<h3>The shiny new CSSRegistration control in SharePoint 2010</h3>
<p>So things are much better in the SharePoint 2010 world. If you examine the <a title="SDK documentation for SharePoint 2010 CSSRegistration control" href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.cssregistration_properties%28office.14%29.aspx" target="_blank">documentation for the SharePoint 2010 version of the CSSRegistration control</a>, you&#8217;ll find the addition of the following properties, which currently have no descriptions to their usage in the SDK:</p>
<h4>RevealToNonIE (boolean)</h4>
<p>I assume this property would allow you to register IE-only style sheets.  This doesn&#8217;t seem to be working in Beta 2 though as it doesn&#8217;t matter whether I set this to true or false, the CSS files would get emitted regardless of the browser I was using.</p>
<h4>ConditionalExpression (string)</h4>
<p><del datetime="2010-03-01T21:33:32+00:00">Another assumption that this would allow us to set certain conditions in order for the style sheet to appear in HTML. Nothing at all in the way of documentation nor could I find any examples in the 14 Hive as of Beta 2.</del></p>
<p>This property is an <a href="http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx" title="Internet Explorer Conditional Comments documentation on MSDN">Internet Explorer Conditional Comment</a>. For example, if we wanted to link to a style sheet specific to IE 7 or greater, we can do this:</p>
<pre class="brush: plain; title: ; notranslate">&lt;SharePoint:CSSRegistration Name=&quot;foo.css&quot; ConditionalExpression=&quot;gte IE 7&quot; runat=&quot;server&quot; /&gt;</pre>
<p>The following markup would be emitted:</p>
<pre class="brush: plain; title: ; notranslate">
&lt;!--[if gte IE 7]&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;foo.css&quot;/&gt;
&lt;![endif]--&gt;
</pre>
<h4>After (string)</h4>
<p>This property is what was sorely missing in 2007. We can now tell the CSSLink control to emit the registered style sheet after another CSS file. You can either define just the leaf filename, ie <em>bar.css</em> or the path to the CSS file, ie <em>/foo/bar.css</em>. If you don&#8217;t use the After property, style sheets will still be emitted by alphabetical order. For example:</p>
<pre class="brush: plain; title: ; notranslate">&lt;SharePoint:CSSRegistration Name=&quot;bar.css&quot; After=&quot;foo.css&quot; runat=&quot;server&quot; /&gt;
&lt;SharePoint:CSSRegistration Name=&quot;foo.css&quot; runat=&quot;server&quot; /&gt;</pre>
<p><em>bar.css</em> is emitted after <em>foo.css</em> because we specified the <strong>After</strong> property when we registered <em>bar.css</em>:</p>
<pre class="brush: plain; title: ; notranslate">&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;foo.css&quot;/&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;bar.css&quot;/&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/_layouts/1033/styles/Themable/corev4.css?rev=...&quot;/&gt;</pre>
<p>corev4.css IS STILL emitted after everything else for whatever reason, unless you use the <strong>After=&#8221;corev4.css&#8221;</strong> property when registering AND there are a few gotchas that you need to be aware of.</p>
<h5>Gotcha 1: You&#8217;re never sure of the sort order</h5>
<p>As of Beta 2, there&#8217;s some weirdness when you register multiple style sheets that all require to be after the same CSS file. They are no longer sorted alphabetically but in most cases they end up being last in first out:</p>
<pre class="brush: plain; title: ; notranslate">&lt;SharePoint:CSSRegistration Name=&quot;1.css&quot; After=&quot;corev4.css&quot; runat=&quot;server&quot; /&gt;
&lt;SharePoint:CSSRegistration Name=&quot;2.css&quot; After=&quot;corev4.css&quot; runat=&quot;server&quot; /&gt;
&lt;SharePoint:CSSRegistration Name=&quot;3.css&quot; After=&quot;corev4.css&quot; runat=&quot;server&quot; /&gt;</pre>
<p>I was expecting 1, 2, 3&#8230; but instead I get 3, 2, 1&#8230;</p>
<pre class="brush: plain; title: ; notranslate">&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/_layouts/1033/styles/Themable/corev4.css?rev=...&quot;/&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;3.css&quot;/&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;2.css&quot;/&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;1.css&quot;/&gt;</pre>
<h5>Gotcha 2: I need something AFTER another thing&#8230;</h5>
<p>The other thing to take note on is when you need to define nested After. For example, I need to make sure that the style sheets are emitted in the order 1, 2, 3, 4:</p>
<pre class="brush: plain; title: ; notranslate">&lt;SharePoint:CSSRegistration Name=&quot;1.css&quot; runat=&quot;server&quot; /&gt;
&lt;SharePoint:CSSRegistration Name=&quot;2.css&quot; After=&quot;1.css&quot; runat=”server&quot; /&gt;
&lt;SharePoint:CSSRegistration Name=&quot;3.css&quot; After=&quot;2.css&quot; runat=&quot;server&quot; /&gt;
&lt;SharePoint:CSSRegistration Name=&quot;4.css&quot; After=&quot;3.css&quot; runat=&quot;server&quot; /&gt;</pre>
<p>We don&#8217;t get what we would expect the result to be, instead it comes out as 1, 4, 3, 2:</p>
<pre class="brush: plain; title: ; notranslate">&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;1.css&quot;/&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;4.css&quot;/&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;3.css&quot;/&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;2.css&quot;/&gt;</pre>
<p>It looks like as a general rule of thumb, you should register the style sheet which comes after another one FIRST. So in order to get 1, 2, 3, 4 we need to define our registration like so:</p>
<pre class="brush: plain; title: ; notranslate">&lt;SharePoint:CSSRegistration Name=&quot;4.css&quot; After=&quot;3.css&quot; runat=&quot;server&quot; /&gt;
&lt;SharePoint:CSSRegistration Name=&quot;3.css&quot; After=&quot;2.css&quot; runat=&quot;server&quot; /&gt;
&lt;SharePoint:CSSRegistration Name=&quot;2.css&quot; After=&quot;1.css&quot; runat=&quot;server&quot; /&gt;
&lt;SharePoint:CSSRegistration Name=&quot;1.css&quot; runat=&quot;server&quot; /&gt;</pre>
<h4>EnableCssTheming (boolean)</h4>
<p>Remember those &#8220;Themable folders&#8221; and compile time directives in the CSS files I mentioned about in Part 1? The EnableCssTheming property tells the SharePoint 2010 theming engine to recompile the style sheet using any directives found within the registered CSS file if the file&#8217;s location is in one of those &#8220;Themable&#8221; folders. EnableCssTheming is &#8220;true&#8221; by default, you have to explicitly set it to &#8220;false&#8221; if you do not want the registered style sheet to be parsed and re-compiled.</p>
<p>For example:</p>
<pre class="brush: plain; title: ; notranslate">&lt;SharePoint:CSSRegistration Name=&quot;&lt;% $SPUrl:~sitecollection/_layouts/1033/Styles/Themable/foo.css %&gt;&quot; runat=&quot;server&quot; /&gt;</pre>
<p>If we don&#8217;t have a theme selected, the HTML emitted will be:</p>
<pre class="brush: plain; title: ; notranslate">&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/_layouts/1033/Styles/Themable/foo.css&quot;/&gt;</pre>
<p>But if there&#8217;s a theme applied to a site, it will be in one of two locations, where [1234567] and [12345678] are hex values that represent the theme name and CSS file paths. The ctag QueryString parameter is a simple integer counter used for cache invalidation. It increments up every time a web&#8217;s theme gets changed.</p>
<p>If the theme was applied through the web UI:</p>
<pre class="brush: plain; title: ; notranslate">&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/[WEB PATH]/_themes/[COUNTER]/foo-[12345678].css?ctag=[COUNTER]&quot;/&gt;</pre>
<p>Or, if the theme was set programmatically using the <a title="SDK documentation for SharePoint 2010 ThmxTheme class" href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.utilities.thmxtheme%28office.14%29.aspx" target="_blank">ThmxTheme</a> class and shareGenerate was defined as &#8220;true&#8221; it will be located here:</p>
<pre class="brush: plain; title: ; notranslate">&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/_catalogs/theme/Themed/[1234567]/foo-[12345678].css?ctag=[COUNTER]&quot;/&gt;</pre>
<p>Just to re-iterate, the <del datetime="2009-12-29T23:51:54+00:00">two</del> three locations where the &#8220;Themable&#8221; folder can be located are:</p>
<ol>
<li>In the &#8220;14 hive&#8221; at <em>%ProgramFiles%\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\[LCID]\STYLES\Themable</em>;
<p>Where [LCID] is the Locale ID. In North America, the default is &#8220;<strong>1033</strong>&#8221; for English (US).</p>
</li>
<li>In each web&#8217;s <em>Style Library/Themable</em>. These CSS files only affect the specific web and all languages.</li>
<li>In each web&#8217;s <em>Style Library/[LANG]/Themable</em>.
<p>These CSS files only affect the specific web and a specific language. In North America, the default is &#8220;<strong>en-US</strong>&#8220;</p>
</li>
</ol>
<p>You can place your CSS files inside sub-folders of Themable for neatness but not the other way around&#8230; <em>/Style Library/Themable/foo/bar.css</em> will be recompiled by SharePoint 2010&#8242;s theming engine while <em>/Style Library/foo/Themable/bar.css</em> will not.</p>
<h3>In the next episode…</h3>
<p>Whew! We&#8217;ve now gone through how to register a style sheet so that it&#8217;s compatible with the new SharePoint 2010 theming engine.</p>
<p>My next post will be how to get our custom style sheets onto the out-of-the-box collaboration sites without having to create custom site templates or master pages. We&#8217;ll revisit an old friend (or new acquaintance to some), the <strong>Delegate Control</strong>!</p>
<p><strong>UPDATE:</strong></p>
<ul>
<li><a title="Branding SharePoint 2010 Collaboration Sites: Part 1" href="/2009/12/23/branding-sharepoint-2010-collaboration-sites-part-1-in-a-series/">You can find Part One here!</a></li>
<li><a title="Branding SharePoint 2010 Collaboration Sites: Part 3" href="/2010/02/23/branding-sharepoint-2010-collaboration-sites-part-3-in-a-series/">You can find Part Three here!</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://singchan.com/2009/12/29/branding-sharepoint-2010-collaboration-sites-part-2-in-a-series/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Branding SharePoint 2010 Collaboration Sites: Part 1 in a Series</title>
		<link>http://singchan.com/2009/12/23/branding-sharepoint-2010-collaboration-sites-part-1-in-a-series/</link>
		<comments>http://singchan.com/2009/12/23/branding-sharepoint-2010-collaboration-sites-part-1-in-a-series/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 19:00:49 +0000</pubDate>
		<dc:creator>Buta</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[branding]]></category>
		<category><![CDATA[collaboration]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[SPC09]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[theming system]]></category>
		<category><![CDATA[ThmxTheme]]></category>
		<category><![CDATA[ue]]></category>
		<category><![CDATA[user experience]]></category>

		<guid isPermaLink="false">http://singchan.com/?p=59</guid>
		<description><![CDATA[Themes are dead! Long live themes! The &#8220;awkward&#8221; themes system based on CSS and images in SharePoint 2007 is going the way of the dodo. No more deploying into the &#8220;12 hive&#8221; and having to modify the SPThemes.XML to register your theme. As you may already know, in SharePoint 2010, themes are now just a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Themes are dead! Long live themes!</strong></p>
<p>The &#8220;awkward&#8221; themes system based on CSS and images in SharePoint 2007 is going the way of the dodo. No more deploying into the &#8220;12 hive&#8221; and having to modify the SPThemes.XML to register your theme.</p>
<p>As you may already know, in SharePoint 2010, themes are now just a set of colour and font values specified in an Office .thmx file. You upload a .thmx file into the Themes catalog and a site administrator can &#8220;theme&#8221; their site using the updated Themes web interface.</p>
<p>Unfortunately, if you want to brand any of the out-of-the-box SharePoint 2010 collaboration sites beyond colours and a couple of font choices, you will need to jump through a few hoops. All of which I&#8217;ll try to explain to you in this series of blog posts.</p>
<h3>How does the SharePoint 2010 Theming Engine work?</h3>
<p>So what happens behind the scenes when you select a 2010 theme to apply to your site? How do the new colours specified in the .thmx file and/or the colours you&#8217;ve chosen through the web interface get applied to your site?</p>
<p>There  are essentially two main locations where CSS files for SharePoint 2010 are stored:<br />
<div id="attachment_122" class="wp-caption alignright" style="width: 160px"><a href="http://singchan.com/wordpress/wp-content/uploads/2009/12/14hive_themable.gif" rel="lightbox[59]" title="Themable folder in 14 Hive"><img class="size-thumbnail wp-image-122" title="Themable folder in 14 Hive" src="http://singchan.com/wordpress/wp-content/uploads/2009/12/14hive_themable-150x150.gif" alt="Themable folder in 14 Hive" width="150" height="150" /></a><p class="wp-caption-text">Themable folder in 14 Hive</p></div></p>
<ol>
<li>In the &#8220;14 hive&#8221; at <em>%ProgramFiles%\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033\STYLES</em>;
<p>The exact location of the CSS files varies depending on whether you have a language pack installed and have another language as the default. I&#8217;m in North America and the Locale ID for the majority of our projects is 1033 for English (US).</p>
<p>These CSS files are used by all webs located on the front-end web server.</p>
</li>
<li>In each web&#8217;s <em>Style Library. </em>These CSS files only affect the specific web.</li>
</ol>
<div id="attachment_127" class="wp-caption alignright" style="width: 160px"><a href="http://singchan.com/wordpress/wp-content/uploads/2009/12/stylelibrary_themable.gif" rel="lightbox[59]" title="Themable folder in web&#039;s Style Library"><img src="http://singchan.com/wordpress/wp-content/uploads/2009/12/stylelibrary_themable-150x94.gif" alt="Themable folder in web&#039;s Style Library" title="Themable folder in web&#039;s Style Library" width="150" height="94" class="size-thumbnail wp-image-127" /></a><p class="wp-caption-text">Themable folder in web's Style Library</p></div>
<p>Oh, btw, when I say &#8220;web,&#8221; I mean SPWeb&#8230; if you&#8217;re a SP Dev, you&#8217;ll know what I&#8217;m talking about, otherwise think &#8220;site&#8221; but not &#8220;SPSite&#8221;&#8230;</p>
<p>So you must be thinking, &#8220;that&#8217;s exactly the same as in SharePoint 2007!&#8221; And you would be right, but if you look in the first location, you&#8217;ll notice a folder named &#8220;Themable&#8221;&#8230;</p>
<p>If you look in the Style Library of a team site, you won&#8217;t find anything&#8230; <img src='http://singchan.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  BUT if you were to create a Publishing Portal and look inside the Style Library, you&#8217;ll find a &#8220;Themable&#8221; folder as well&#8230;</p>
<p>Taking a look at some of the CSS files, you&#8217;ll notice some things in the CSS comments like:</p>
<pre class="brush: plain; title: ; notranslate">/*[ReplaceColor(themeColor:&quot;Light1&quot;)]*/
background-color: #fff;

/*[RecolorImage(themeColor:&quot;Accent6&quot;,method:&quot;Tinting&quot;)]*/
background-image:url(&quot;/_layouts/images/selectednav.gif&quot;);</pre>
<p><strong>What this? Compile time directives?</strong></p>
<p>Yup, when the user selects a theme for a web, SharePoint goes and recompiles the CSS and places the compiled CSS files into the web&#8217;s &#8220;_theme&#8221; folder.</p>
<p><strong>UPDATE:</strong> There&#8217;s also a second location in the content DB where a compiled theme could live besides a web&#8217;s &#8220;_theme&#8221;. If you use the <a title="SDK documentation for SharePoint 2010 ThmxTheme.SetThemeUrlForWeb method" href="http://msdn.microsoft.com/en-us/library/ee658324%28office.14%29.aspx" target="_blank">ThmxTheme.SetThemeUrlForWeb</a> method to set the web&#8217;s theme and specify &#8220;true&#8221; for the <strong>shareGenerated</strong> parameter, the compiled CSS files will be located in &#8220;/_catalogs/theme/Themed/[1234567]&#8221; instead. [1234567] is some hex value based on the theme name or folder, not exactly sure ATM.</p>
<p>SharePoint will replace any colors defined in the rule following the comment with the matching colour that&#8217;s defined in the .thmx or the web interface. It can even re-render graphics based on pixel co-ordinates, tinting (as seen in the second example above) or even re-render gradients for you! This is going to be a great time saver for projects where requirement dictates multiple colour variations on a central design!</p>
<div id="attachment_134" class="wp-caption aligncenter" style="width: 310px"><a href="http://singchan.com/wordpress/wp-content/uploads/2009/12/themingengine.jpg" rel="lightbox[59]" title="How the SharePoint 2010 Theming Engine Works"><img src="http://singchan.com/wordpress/wp-content/uploads/2009/12/themingengine-300x225.jpg" alt="How the SharePoint 2010 Theming Engine Works" title="How the SharePoint 2010 Theming Engine Works" width="300" height="225" class="size-medium wp-image-134" /></a><p class="wp-caption-text">Slide shamelessly stolen from Elisabeth Olsen's presentation at SPC09.</p></div>
<p>What are all the directives? Dunno. There&#8217;s absolutely no documentation that I&#8217;ve found at the moment. There&#8217;s plenty of examples sprinkled throughout the CSS files found in the &#8220;Themable&#8221; folders though. I&#8217;m hoping someone out there compiles a list of all of them sooner rather than later.</p>
<h3>In the next episode&#8230;</h3>
<p>My next post will be on the new and improved <strong>CSSRegistration</strong> control which is how we can add our own custom CSS that can also take advantage of the new 2010 theming system!</p>
<p><strong>UPDATE:</strong></p>
<ul>
<li><a title="Branding SharePoint 2010 Collaboration Sites: Part 2" href="/2009/12/29/branding-sharepoint-2010-collaboration-sites-part-2-in-a-series/">You can find Part Two here!</a></li>
<li><a title="Branding SharePoint 2010 Collaboration Sites: Part 3" href="/2010/02/23/branding-sharepoint-2010-collaboration-sites-part-3-in-a-series/">You can find Part Three here!</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://singchan.com/2009/12/23/branding-sharepoint-2010-collaboration-sites-part-1-in-a-series/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

