<?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>SPSherm.MyBlog &#187; CSS</title>
	<atom:link href="http://spsherm.uptempoconsulting.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://spsherm.uptempoconsulting.com</link>
	<description>SharePoint, of course.</description>
	<lastBuildDate>Mon, 03 Oct 2011 03:01:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Registering a CSS File in SharePoint</title>
		<link>http://spsherm.uptempoconsulting.com/2008/06/registering-a-css-file-in-sharepoint/</link>
		<comments>http://spsherm.uptempoconsulting.com/2008/06/registering-a-css-file-in-sharepoint/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 00:26:50 +0000</pubDate>
		<dc:creator>Sherman</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SP2007]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[WCM]]></category>

		<guid isPermaLink="false">http://spsherm.uptempoconsulting.com/?p=135</guid>
		<description><![CDATA[I have a custom publishing site definition. It was, of course, based off the default publishing site definition. I re-organized some features around, and added custom versions of required features just so I could control everything a little more to my liking. Anytime we do this, however, we run the risk of &#8220;what did I break?&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>I have a custom publishing site definition. It was, of course, based off the default publishing site definition. I re-organized some features around, and added custom versions of required features just so I could control everything a little more to my liking. Anytime we do this, however, we run the risk of &#8220;what did I break?&#8221; syndrome.</p>
<p>One of my clients was using the Content Editor Web Part on one of her page layouts (instead of using a RichHtmlField &#8211; long story). She noted that she could not select the &#8220;Use Predefined Table Format&#8221; in the Table Editor web dialog. Hmmm&#8230; I didn&#8217;t do anything specific to <em>disable</em> that capability, so I needed to do some digging.</p>
<p>Since I was using a custom publishing site definition, I needed to determine if this behaviour was happening with the default Publishing Portal definition. Sure enough, adding a CEWP to the home page of the Publishing Portal yielded the same effect: I could not use the predefined table formats. I then check the Press Releases default page, which does have a RichHtmlField for me to play with. I <em>can</em> use the predefined formats here. I proceeded to add a CEWP to the zone at the bottom of the page, and here I can also use the predefined formats. Interesting&#8230;</p>
<p>I fired up my favourite search engine, and came across this posting from Microsoft: <a title="http://support.microsoft.com/kb/948320" href="http://support.microsoft.com/kb/948320">How to enable the &#8220;Use Predefined Table Format&#8221; setting when you use a Windows SharePoint Services template in SharePoint Server 2007</a>. Cool! But note the location of the CSS: /_LAYOUTS/1033/STYLES/HtmlEditorTableFormats.css. In my case, I have the French language pack installed, which means I have to account for the 1036 LCID also.</p>
<p>I checked the master pages and page layouts that PublishingLayouts feature use, and note that there is <em>not</em> a reference to that CSS. Nor is it in the page layouts found in the PublishingResources feature. What gives? What&#8217;s the correct syntax?</p>
<p>No matter. I&#8217;ll just add a link to the CSS by building out the path to the right LCID folder, using something like System.Threading.Thread.CurrentThread.CurrentUICulture to get the LCID. After some frustrations (which I won&#8217;t get into here), I quickly realized that this would not work in my scenario (Canadian English is not 1033) either.</p>
<p>I looked at the source code for my out-of-the-box publishing portal (the Press Releases page). I noticed that core.css also comes from the LAYOUTS/1033/Styles folder. Some more digging, and I realized that I did not need to specify the full path, like this example taken from BlueBand.master:</p>
<pre class="brush: xml; title: ; notranslate">&lt;SharePoint:CssRegistration name=&quot;&lt;% $SPUrl:~sitecollection/Style Library/~language/Core Styles/controls.css %&gt;&quot; runat=&quot;server&quot;/&gt;</pre>
<p>but instead I needed simply this:</p>
<pre class="brush: xml; title: ; notranslate">&lt;SharePoint:CssRegistration name=&quot;HtmlEditorTableFormats.css&quot; runat=&quot;server&quot; /&gt;</pre>
<p>and SharePoint takes care of the rest, building out the path to the appropriate Styles as required, like this:  </p>
<pre class="brush: xml; title: ; notranslate">&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/_layouts/1033/styles/Htmleditortableformats.css?rev=guYGdUBUxQit03E2jhSdvA&quot; /&gt;</pre>
<p><a title="http://blog.mastykarz.nl/tag/rich-text-editor/" href="http://blog.mastykarz.nl/tag/rich-text-editor/">Here is a great post which talks about what&#8217;s going on</a>, and what renders HtmlEditorTableFormats links. It explains why I could not find it in any of the master pages or page layouts: the RichHtmlField web control inserts CSS links to HtmlEditorTableFormats.css and HtmlEditorCustomStyles.css OnLoad() . &lt;groan! /&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://spsherm.uptempoconsulting.com/2008/06/registering-a-css-file-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

