{"id":59,"date":"2009-12-23T11:00:49","date_gmt":"2009-12-23T19:00:49","guid":{"rendered":"http:\/\/singchan.com\/?p=59"},"modified":"2010-02-23T08:10:01","modified_gmt":"2010-02-23T16:10:01","slug":"branding-sharepoint-2010-collaboration-sites-part-1-in-a-series","status":"publish","type":"post","link":"https:\/\/singchan.com\/wordpress\/2009\/12\/23\/branding-sharepoint-2010-collaboration-sites-part-1-in-a-series\/","title":{"rendered":"Branding SharePoint 2010 Collaboration Sites: Part 1 in a Series"},"content":{"rendered":"<p><strong>Themes are dead! Long live themes!<\/strong><\/p>\n<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>\n<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\u00c2\u00a0a\u00c2\u00a0.thmx file into\u00c2\u00a0the Themes catalog and\u00c2\u00a0a site administrator can &#8220;theme&#8221; their site using the updated Themes web interface.<\/p>\n<p>Unfortunately, if you want to brand\u00c2\u00a0any of the\u00c2\u00a0out-of-the-box SharePoint\u00c2\u00a02010 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>\n<h3>How does the SharePoint 2010 Theming Engine work?<\/h3>\n<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>\n<p>There\u00c2\u00a0 are essentially two main locations where CSS files for SharePoint 2010 are stored:<br \/>\n<div id=\"attachment_122\" style=\"width: 160px\" class=\"wp-caption alignright\"><a href=\"https:\/\/singchan.com\/wordpress\/wp-content\/uploads\/2009\/12\/14hive_themable.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-122\" class=\"size-thumbnail wp-image-122  \" title=\"Themable folder in 14 Hive\" src=\"https:\/\/singchan.com\/wordpress\/wp-content\/uploads\/2009\/12\/14hive_themable-150x150.gif\" alt=\"Themable folder in 14 Hive\" width=\"150\" height=\"150\" \/><\/a><p id=\"caption-attachment-122\" class=\"wp-caption-text\">Themable folder in 14 Hive<\/p><\/div><\/p>\n<ol>\n<li>In the &#8220;14 hive&#8221; at <em>%ProgramFiles%\\Common Files\\Microsoft Shared\\Web Server Extensions\\14\\TEMPLATE\\LAYOUTS\\1033\\STYLES<\/em>;\n<p>The exact location of the CSS files\u00c2\u00a0varies 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>\n<p>These CSS files are used by all webs located on the front-end web server.<\/p>\n<\/li>\n<li>In each web&#8217;s <em>Style Library. <\/em>These CSS files only affect the specific web.<\/li>\n<\/ol>\n<div id=\"attachment_127\" style=\"width: 160px\" class=\"wp-caption alignright\"><a href=\"https:\/\/singchan.com\/wordpress\/wp-content\/uploads\/2009\/12\/stylelibrary_themable.gif\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-127\" src=\"https:\/\/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 id=\"caption-attachment-127\" class=\"wp-caption-text\">Themable folder in web's Style Library<\/p><\/div>\n<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>\n<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>\n<p>If you look in the Style Library of a team site, you won&#8217;t find anything&#8230; \ud83d\ude42 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>\n<p>Taking a look at some of the CSS files, you&#8217;ll notice some things in the CSS comments like:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\/*&#x5B;ReplaceColor(themeColor:&quot;Light1&quot;)]*\/\r\nbackground-color: #fff;\r\n\r\n\/*&#x5B;RecolorImage(themeColor:&quot;Accent6&quot;,method:&quot;Tinting&quot;)]*\/\r\nbackground-image:url(&quot;\/_layouts\/images\/selectednav.gif&quot;);<\/pre>\n<p><strong>What this? Compile time directives?<\/strong><\/p>\n<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>\n<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>\n<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>\n<div id=\"attachment_134\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/singchan.com\/wordpress\/wp-content\/uploads\/2009\/12\/themingengine.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-134\" src=\"https:\/\/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\" srcset=\"https:\/\/singchan.com\/wordpress\/wp-content\/uploads\/2009\/12\/themingengine-300x225.jpg 300w, https:\/\/singchan.com\/wordpress\/wp-content\/uploads\/2009\/12\/themingengine.jpg 670w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-134\" class=\"wp-caption-text\">Slide shamelessly stolen from Elisabeth Olsen's presentation at SPC09.<\/p><\/div>\n<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>\n<h3>In the next episode&#8230;<\/h3>\n<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>\n<p><strong>UPDATE:<\/strong><\/p>\n<ul>\n<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>\n<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>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,5,25,43],"tags":[44,97,99,56,42,45,55,98,100,47,46],"class_list":["post-59","post","type-post","status-publish","format-standard","hentry","category-design","category-development","category-html-css","category-sharepoint-development","tag-44","tag-branding","tag-collaboration","tag-css","tag-sharepoint","tag-spc09","tag-themes","tag-theming-system","tag-thmxtheme","tag-ue","tag-user-experience"],"_links":{"self":[{"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/posts\/59","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/comments?post=59"}],"version-history":[{"count":26,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/posts\/59\/revisions"}],"predecessor-version":[{"id":219,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/posts\/59\/revisions\/219"}],"wp:attachment":[{"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/media?parent=59"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/categories?post=59"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/singchan.com\/wordpress\/wp-json\/wp\/v2\/tags?post=59"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->