<?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; 2010</title>
	<atom:link href="http://singchan.com/tag/2010/feed/" rel="self" type="application/rss+xml" />
	<link>http://singchan.com</link>
	<description>The House of Pork and User Experience Development</description>
	<lastBuildDate>Sat, 31 Jul 2010 21:49:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>SharePoint 2010: Fixing the MSDN Contextual Tab Web Part Walkthrough</title>
		<link>http://singchan.com/2010/07/31/sharepoint-2010-fixing-the-msdn-contextual-tab-web-part-walkthrough/</link>
		<comments>http://singchan.com/2010/07/31/sharepoint-2010-fixing-the-msdn-contextual-tab-web-part-walkthrough/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 21:49:54 +0000</pubDate>
		<dc:creator>Buta</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Ribbon]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Web Part]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[contextual tab]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[ribbon]]></category>
		<category><![CDATA[ue]]></category>
		<category><![CDATA[user experience]]></category>
		<category><![CDATA[web part]]></category>

		<guid isPermaLink="false">http://singchan.com/?p=268</guid>
		<description><![CDATA[I haven&#8217;t had much opportunity to work with SharePoint 2010 in the past few months. However, I did get to try out the MSDN walkthrough for creating a custom web part with contextual ribbon tab recently. You can find the article here: http://msdn.microsoft.com/en-us/library/ff407578.aspx In a nutshell, what&#8217;s supposed to happen is when you click on [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t had much opportunity to work with SharePoint 2010 in the past few months. However, I did get to try out the MSDN walkthrough for creating a custom web part with contextual ribbon tab recently. You can find the article here: <a href="http://msdn.microsoft.com/en-us/library/ff407578.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/ff407578.aspx</a></p>
<p>In a nutshell, what&#8217;s supposed to happen is when you click on the web part, there will be a custom tab that appears in the Ribbon. It all works great for the first instance of the custom web part you place onto a page, but if you try adding a second instance of the web part, your page blows up!</p>
<p>You&#8217;ll get the following error:<br />
<em>Item has already been added. Key in dictionary: &#8216;Ribbon.CustomContextualTabGroup&#8217;  Key being added: &#8216;Ribbon.CustomContextualTabGroup&#8217;</em></p>
<p>:-/ &#8230; looks like there wasn&#8217;t much QA done for the walkthrough. Anyways, to make a short story shorter&#8230; I posted a question on the <a href="http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/8604fda5-dad3-49e5-b820-af98ae2fb3cf" target="_blank">TechNet forums</a> and Dallas Tester from MS did get back to me with a bunch of suggestions.</p>
<p>Here are the changes you can make to allow for multiple instances of the custom web part to appear on the page without everything blowing up.</p>
<p><strong>Make the following modifications to the ContextualTabWebPart class.</strong></p>
<p>Add the global &#8216;_added&#8217; bool and OnInit event handler:</p>
<pre class="brush: csharp;">static bool _added = false;

protected override void OnInit(EventArgs e)
{
 base.OnInit(e);
 _added = false;
}</pre>
<p>Since we no longer have to get the unique component ID in the delay script, I changed DelayScript into a private string:</p>
<pre class="brush: csharp;">private string delayScript = @&quot;
 function _addCustomPageComponent()
 {
  for (var i = 0; i &lt; g_customWebPartIds.length; i++)
  {
    SP.Ribbon.PageManager.get_instance().addPageComponent(new ContextualTabWebPart.CustomPageComponent(g_customWebPartIds[i]));
  }
 }

 function _registerCustomPageComponent()
 {
  SP.SOD.registerSod(&quot;&quot;CustomContextualTabPageComponent.js&quot;&quot;, &quot;&quot;/_layouts/CustomContextualTabPageComponent.js&quot;&quot;);
  var isDefined = &quot;&quot;undefined&quot;&quot;;
  try
  {
   isDefined = typeof(ContextualTabWebPart.CustomPageComponent);
  }
  catch(e)
  {
  }
  EnsureScript(&quot;&quot;CustomContextualTabPageComponent.js&quot;&quot;,isDefined, _addCustomPageComponent);
 }
 SP.SOD.executeOrDelayUntilScriptLoaded(_registerCustomPageComponent, &quot;&quot;sp.ribbon.js&quot;&quot;);&quot;;</pre>
<p>Modify the OnPreRender event handler:</p>
<pre class="brush: csharp;">protected override void OnPreRender(EventArgs e)
{
 base.OnPreRender(e);

 ClientScriptManager csm = this.Page.ClientScript;
 string componentId = SPRibbon.GetWebPartPageComponentId(this); // the unique component id 

 // if this is the first instance of the custom web part,
 //we need to add the contextual tab to the ribbon
 if (!_added)
 {
  this.AddContextualTab();
  _added = true;
 }

 // we need to create an array which will store the IDs of all instances of our custom web part
 csm.RegisterClientScriptBlock(
  this.GetType(), &quot;DeclareCustomWebPartArray&quot;, &quot;var g_customWebPartIds = new Array();&quot;, true);

 // add this webpart's ID to our array
 csm.RegisterClientScriptBlock(
  this.GetType(), &quot;AddCustomWebPartId&quot; + componentId, &quot;g_customWebPartIds.push('&quot; + componentId + &quot;');&quot;, true);

 csm.RegisterClientScriptBlock(this.GetType(), &quot;ContextualTabWebPart&quot;, this.delayScript, true);
}</pre>
<p><strong>If you want to verify that the correct web part is trigger the Ribbon commands, you can modify the &#8216;<em>handleCommand</em>&#8216; method in &#8216;<em>CustomContextualTabPageComponent.js</em>&#8216;</strong></p>
<pre class="brush: jscript;">handleCommand: function ContextualTabWebPart_CustomPageComponent$handleCommand(commandId, properties, sequence) {
 if (commandId === 'CustomContextualTab.HelloWorldCommand') {
  alert(this._webPartPageComponentId + ' says: Hello, world!');
 }
 if (commandId === 'CustomContextualTab.GoodbyeWorldCommand') {
  alert(this._webPartPageComponentId + ' says: Good-bye, world!');
 }
}</pre>
<p>Here&#8217;s a <a href="http://singchan.com/wordpress/wp-content/uploads/2010/07/ContextualTabWebPart.zip">ZIP file of the entire solution</a> in case you&#8217;re too lazy to make the modifications yourself. <img src='http://singchan.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://singchan.com/2010/07/31/sharepoint-2010-fixing-the-msdn-contextual-tab-web-part-walkthrough/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010: CssRegistration ConditionalExpression Property</title>
		<link>http://singchan.com/2010/03/01/sharepoint-2010-cssregistration-conditionalexpression-property/</link>
		<comments>http://singchan.com/2010/03/01/sharepoint-2010-cssregistration-conditionalexpression-property/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 21:57:17 +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[conditional comment]]></category>
		<category><![CDATA[ConditionalExpression]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSSRegistration]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[ue]]></category>
		<category><![CDATA[user experience]]></category>
		<category><![CDATA[ux]]></category>

		<guid isPermaLink="false">http://singchan.com/?p=262</guid>
		<description><![CDATA[In a previous post detailing the new SharePoint 2010 CssRegistration control, I mentioned that I did not know what the ConditionalExpression property did. Well, now I do! This property takes an Internet Explorer Conditional Comment. For example, if we wanted to link to a style sheet specific to IE 7 or greater, we can do [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous post detailing the <a href="/2009/12/29/branding-sharepoint-2010-collaboration-sites-part-2-in-a-series/">new SharePoint 2010 CssRegistration control</a>, I mentioned that I did not know what the ConditionalExpression property did. Well, now I do!</p>
<p>This property takes 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;">&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;">
&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>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://singchan.com/2010/03/01/sharepoint-2010-cssregistration-conditionalexpression-property/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where were you&#8230;</title>
		<link>http://singchan.com/2010/02/28/where-were-you/</link>
		<comments>http://singchan.com/2010/02/28/where-were-you/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 05:56:08 +0000</pubDate>
		<dc:creator>Buta</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[canada]]></category>
		<category><![CDATA[celebration]]></category>
		<category><![CDATA[gold]]></category>
		<category><![CDATA[hockey]]></category>
		<category><![CDATA[medal]]></category>
		<category><![CDATA[olympics]]></category>
		<category><![CDATA[OT]]></category>
		<category><![CDATA[overtime]]></category>
		<category><![CDATA[sidney crosby]]></category>
		<category><![CDATA[vancouver]]></category>

		<guid isPermaLink="false">http://singchan.com/?p=236</guid>
		<description><![CDATA[When Sid the Kid scored in OT to bring home the gold?]]></description>
			<content:encoded><![CDATA[<p>When Sid the Kid scored in OT to bring home the gold?</p>
<div style="text-align:center; margin-bottom: 1em;">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=9818001&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=ff9933&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://vimeo.com/moogaloop.swf?clip_id=9818001&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=ff9933&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object>
</div>
<div style="text-align:center;">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=9818257&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=ff9933&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://vimeo.com/moogaloop.swf?clip_id=9818257&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=ff9933&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object>
</div>

<a href='http://singchan.com/2010/02/28/where-were-you/img_1362/' title='IMG_1362'><img width="150" height="150" src="http://singchan.com/wordpress/wp-content/uploads/2010/02/IMG_1362-150x150.jpg" class="attachment-thumbnail" alt="IMG_1362" title="IMG_1362" /></a>
<a href='http://singchan.com/2010/02/28/where-were-you/img_1367/' title='IMG_1367'><img width="150" height="150" src="http://singchan.com/wordpress/wp-content/uploads/2010/02/IMG_1367-150x150.jpg" class="attachment-thumbnail" alt="IMG_1367" title="IMG_1367" /></a>
<a href='http://singchan.com/2010/02/28/where-were-you/img_1369/' title='IMG_1369'><img width="150" height="150" src="http://singchan.com/wordpress/wp-content/uploads/2010/02/IMG_1369-150x150.jpg" class="attachment-thumbnail" alt="IMG_1369" title="IMG_1369" /></a>
<a href='http://singchan.com/2010/02/28/where-were-you/img_1376/' title='IMG_1376'><img width="150" height="150" src="http://singchan.com/wordpress/wp-content/uploads/2010/02/IMG_1376-150x150.jpg" class="attachment-thumbnail" alt="IMG_1376" title="IMG_1376" /></a>
<a href='http://singchan.com/2010/02/28/where-were-you/img_1378/' title='IMG_1378'><img width="150" height="150" src="http://singchan.com/wordpress/wp-content/uploads/2010/02/IMG_1378-150x150.jpg" class="attachment-thumbnail" alt="IMG_1378" title="IMG_1378" /></a>
<a href='http://singchan.com/2010/02/28/where-were-you/img_1379/' title='IMG_1379'><img width="150" height="150" src="http://singchan.com/wordpress/wp-content/uploads/2010/02/IMG_1379-150x150.jpg" class="attachment-thumbnail" alt="IMG_1379" title="IMG_1379" /></a>
<a href='http://singchan.com/2010/02/28/where-were-you/img_1381/' title='IMG_1381'><img width="150" height="150" src="http://singchan.com/wordpress/wp-content/uploads/2010/02/IMG_1381-150x150.jpg" class="attachment-thumbnail" alt="IMG_1381" title="IMG_1381" /></a>
<a href='http://singchan.com/2010/02/28/where-were-you/img_1382/' title='IMG_1382'><img width="150" height="150" src="http://singchan.com/wordpress/wp-content/uploads/2010/02/IMG_1382-150x150.jpg" class="attachment-thumbnail" alt="IMG_1382" title="IMG_1382" /></a>

<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://singchan.com/2010/02/28/where-were-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some Nice Things to Say About Translink</title>
		<link>http://singchan.com/2010/02/27/some-nice-things-to-say-about-translink/</link>
		<comments>http://singchan.com/2010/02/27/some-nice-things-to-say-about-translink/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 16:53:47 +0000</pubDate>
		<dc:creator>Buta</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[olympics]]></category>
		<category><![CDATA[taxi]]></category>
		<category><![CDATA[transit]]></category>
		<category><![CDATA[translink]]></category>
		<category><![CDATA[wce]]></category>
		<category><![CDATA[west coast express]]></category>

		<guid isPermaLink="false">http://singchan.com/?p=234</guid>
		<description><![CDATA[I would think most things people (and by people I really mean me) say about Translink tend to be on the negative side. Not in this post though! First off, I think it&#8217;s great that Translink has added 3 extra late night runnings of the West Coast Express (WCE) for us people in the boon [...]]]></description>
			<content:encoded><![CDATA[<p>I would think most things people (and by people I really mean me) say about Translink tend to be on the negative side. Not in this post though!</p>
<p>First off, I think it&#8217;s great that Translink has added 3 extra late night runnings of the <a href="http://westcoastexpress.com" title="West Coast Express Commuter Train">West Coast Express (WCE)</a> for us people in the boon docks so that we can stay in downtown Vancouver late to cheer on our olympians. It gets cars, and more importantly one or two drunk drivers behind those cars, off the road! I wish they would run some late night train busses, but I suppose they don&#8217;t get enough capacity to make it sustainable.</p>
<p>Yesterday night I had taken one of the extra late trains to get back home. The bus that takes me home normally stops service sometime around 11:00pm and I was expecting to trudge back up the hill at 1:00 in the morning. To my surprise, there were buses waiting WCE passengers! And even more surprising, they weren&#8217;t following their normal routes! Instead they just served the general areas surrounding their routes and the driver would ask where each passenger where they needed to go and then zipped around town dropping everyone off as if all the passengers where sharing one big taxi!</p>
<p>So thank-you Translink for getting me home quickly and efficiently and for saving me a 20 minute minute trek in the rain!</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://singchan.com/2010/02/27/some-nice-things-to-say-about-translink/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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;">
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;">
&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;">
&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>
<!-- PHP 5.x -->]]></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>4</slash:comments>
		</item>
		<item>
		<title>The Olympic Torch</title>
		<link>http://singchan.com/2010/02/22/the-olympic-torch/</link>
		<comments>http://singchan.com/2010/02/22/the-olympic-torch/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 19:38:33 +0000</pubDate>
		<dc:creator>Buta</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[olympics]]></category>
		<category><![CDATA[torch]]></category>
		<category><![CDATA[vancouver]]></category>
		<category><![CDATA[winter]]></category>

		<guid isPermaLink="false">http://singchan.com/?p=194</guid>
		<description><![CDATA[Sam, one of our QA guys at Habanero, brought to the office the torch his grandfather carried during his leg of the Olympic Torch Relay. Really cool to be able to take a few shots with a torch that&#8217;s been &#8220;kissed&#8221; by the olympic flame!]]></description>
			<content:encoded><![CDATA[<p><a href="http://singchan.com/wordpress/wp-content/uploads/2010/02/IMG_0812.jpg" rel="lightbox[194]" title="Buta with the Torch"><img src="http://singchan.com/wordpress/wp-content/uploads/2010/02/IMG_0812-225x300.jpg" alt="Sing with the Olympic Torch at the office." title="Buta with the Torch" width="225" height="300" class="aligncenter size-medium wp-image-195" /></a></p>
<p>Sam, one of our QA guys at Habanero, brought to the office the torch his grandfather carried during his leg of the Olympic Torch Relay. Really cool to be able to take a few shots with a torch that&#8217;s been &#8220;kissed&#8221; by the olympic flame!</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://singchan.com/2010/02/22/the-olympic-torch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010: Show Dialog on Page Load</title>
		<link>http://singchan.com/2010/02/11/sharepoint-2010-show-dialog-on-page-load/</link>
		<comments>http://singchan.com/2010/02/11/sharepoint-2010-show-dialog-on-page-load/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 19:16:01 +0000</pubDate>
		<dc:creator>Buta</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[dialog]]></category>

		<guid isPermaLink="false">http://singchan.com/?p=191</guid>
		<description><![CDATA[A quick tip&#8230; Because the sp.ui.dialog.js library is lazy-loaded, it may not be available when the page is ready/loaded. I&#8217;ve seen some early examples where if you wanted to do something on page load, you use: _spBodyOnLoadFunctionNames.push(&#34;YourInitFunction()&#34;); This will not work if you want to open a SharePoint dialog on page load. Instead use: ExecuteOrDelayUntilScriptLoaded(YourInitFunction, [...]]]></description>
			<content:encoded><![CDATA[<p>A quick tip&#8230;</p>
<p>Because the sp.ui.dialog.js library is lazy-loaded, it may not be available when the page is ready/loaded. I&#8217;ve seen some early examples where if you wanted to do something on page load, you use:</p>
<pre class="brush: plain;">
_spBodyOnLoadFunctionNames.push(&quot;YourInitFunction()&quot;);
</pre>
<p>This will not work if you want to open a SharePoint dialog on page load. Instead use:</p>
<pre class="brush: plain;">
ExecuteOrDelayUntilScriptLoaded(YourInitFunction, &quot;sp.ui.dialog.js&quot;);
</pre>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://singchan.com/2010/02/11/sharepoint-2010-show-dialog-on-page-load/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010: Upgrading your Public Beta solutions to RC</title>
		<link>http://singchan.com/2010/02/11/sharepoint-2010-upgrading-your-public-beta-solutions-to-rc/</link>
		<comments>http://singchan.com/2010/02/11/sharepoint-2010-upgrading-your-public-beta-solutions-to-rc/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 17:42:38 +0000</pubDate>
		<dc:creator>Buta</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[beta 2]]></category>
		<category><![CDATA[master page]]></category>
		<category><![CDATA[page layout]]></category>
		<category><![CDATA[public beta]]></category>
		<category><![CDATA[RC]]></category>
		<category><![CDATA[release candidate]]></category>
		<category><![CDATA[site template]]></category>

		<guid isPermaLink="false">http://singchan.com/?p=188</guid>
		<description><![CDATA[A word to the wise, if you&#8217;re planning on upgrading your solutions developed on the public beta to the new SharePoint 2010 Release Candidate, double check your code! This is especially true if you have custom master pages, page layouts, or site templates which are derived from the OOTB ones. Here&#8217;s a simple screen grab [...]]]></description>
			<content:encoded><![CDATA[<p>A word to the wise, if you&#8217;re planning on upgrading your solutions developed on the public beta to the new SharePoint 2010 Release Candidate, double check your code!</p>
<p>This is especially true if you have custom master pages, page layouts, or site templates which are derived from the OOTB ones.</p>
<p>Here&#8217;s a simple screen grab of a diff between the Public Beta v4.master and the version in the RC:</p>
<div id="attachment_189" class="wp-caption aligncenter" style="width: 310px"><a href="http://singchan.com/wordpress/wp-content/uploads/2010/02/v4master_diff.png" rel="lightbox[188]" title="V4.master Diff"><img class="size-medium wp-image-189" title="V4.master Diff" src="http://singchan.com/wordpress/wp-content/uploads/2010/02/v4master_diff-300x217.png" alt="Screenshot of differences between the public beta and RC v4.master pages." width="300" height="217" /></a><p class="wp-caption-text">v4.master differences</p></div>
<p>Notice one of the Site Actions menu items has been removed in the RC and permissions are slightly different in another. There are other small differences in the v4.master like some of the sprite co-ordinates have changed for the help and recycle bin icons which might leave you scratching your head as to why the wrong image is showing up.</p>
<p>The v4.master is just a short example. I found quite a few differences in the Blog site template and spent quite a bit of time doing diffs and merging my customizations back into the updated RC versions.</p>
<p>If you&#8217;re using TFS for your source control, I found it helpful to just copy and paste the contents of original version of whatever file you customized into your versioned control file and then doing a difference/merge between that and the last version checked-in.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://singchan.com/2010/02/11/sharepoint-2010-upgrading-your-public-beta-solutions-to-rc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yaroslav on Customizing the SharePoint 2010 Ribbon</title>
		<link>http://singchan.com/2009/12/29/yaroslav-on-customizing-the-sharepoint-2010-ribbon/</link>
		<comments>http://singchan.com/2009/12/29/yaroslav-on-customizing-the-sharepoint-2010-ribbon/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 01:01:56 +0000</pubDate>
		<dc:creator>Buta</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[ribbon]]></category>
		<category><![CDATA[ue]]></category>
		<category><![CDATA[user experience]]></category>
		<category><![CDATA[Yaroslav]]></category>

		<guid isPermaLink="false">http://singchan.com/?p=177</guid>
		<description><![CDATA[My buddy Yaroslav&#8217;s been blogging away about customizing the SharePoint 2010 ribbon, like the mad scientist that he is, over the past few weeks&#8230; Here&#8217;s what he&#8217;s got so far: Extending the SharePoint 2010 Ribbon Screen Cast: Starting with the SharePoint 2010 Ribbon More Ribbon locations to extend your SharePoint 2010 UI Creating a FlyoutAnchor [...]]]></description>
			<content:encoded><![CDATA[<p>My buddy Yaroslav&#8217;s been blogging away about customizing the SharePoint 2010 ribbon, like the mad scientist that he is, over the past few weeks&#8230;</p>
<p>Here&#8217;s what he&#8217;s got so far:</p>
<ul>
<li><a href="http://www.sharemuch.com/2009/12/16/extending-sharepoint-2010-ribbon/" target="_blank">Extending the SharePoint 2010 Ribbon</a></li>
<li><a href="http://www.sharemuch.com/2009/12/19/new-screencast-starting-with-sharepoint-2010-ribbon/" target="_blank">Screen Cast: Starting with the SharePoint 2010 Ribbon</a></li>
<li><a href="http://www.sharemuch.com/2009/12/17/more-ribbon-locations-to-extend-your-sharepoint-2010-ui/" target="_blank">More Ribbon locations to extend your SharePoint 2010 UI</a></li>
<li><a href="http://www.sharemuch.com/2009/12/23/creating-in-sharepoint-2010-ribbon/" target="_blank">Creating a FlyoutAnchor in the Ribbon</a></li>
<li><a href="http://www.sharemuch.com/2009/12/22/addingremoving-social-tagging-i-like-it-on-sharepoint-2010-ribbon/" target="_blank">Adding/Remvoing Social Tagging in the Ribbon</a></li>
<li><a href="http://www.sharemuch.com/2009/12/21/building-more-complex-sharepoint-2010-ribbon-structure/" target="_blank">Building a more complex SharePoint 2010 Ribbon Structure</a></li>
</ul>
<p>Go check it out!</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://singchan.com/2009/12/29/yaroslav-on-customizing-the-sharepoint-2010-ribbon/feed/</wfw:commentRss>
		<slash:comments>0</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;">&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;">&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;">&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;">
&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;">&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;">&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;">&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;">&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;">&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;">&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;">&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;">&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;">&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;">&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;">&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>
<!-- PHP 5.x -->]]></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>5</slash:comments>
		</item>
	</channel>
</rss>
