in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

SPSherm.MyBlog

Sharing points about SharePoint...

June 2008 - Posts

  • Visual Studio Extensions for WSS 1.2 - Too Bad I Can't Use Them

    (Not in my native Windows environment anyway.) 

    I have a few spare moments at work right now. I've got Windows Server 2003 x64 with a local installation of SharePoint as my development environment. (You can debate the merits of this v. using a VM, but I prefer to have direct access to my hardware.) I wanted to check out the VS extensions, so I can quickly do "one-offs" instead of creating full solutions everytime.

    I downloaded the extension which can be found here. Tried to install, and boom!

    "This product cannot be installed on 64-bit versions of Windows." [OK]

    What! No! Not OK. Some digging, and reading the comments on the SharePoint Team Blog, I came across this post: http://blogs.msdn.com/mattbremer/archive/2008/06/17/why-do-visual-studio-extensions-for-wss-3-0-not-support-64-bit-platforms.aspx

    Heavy sigh... time to take a closer look at Ted Pattison Group's STSDEV...

  • Registering a CSS File in SharePoint

    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 "what did I break?" syndrome.

    One of my clients was using the Content Editor Web Part on one of her page layouts (instead of using a RichHtmlField - long story). She noted that she could not select the "Use Predefined Table Format" in the Table Editor web dialog. Hmmm... I didn't do anything specific to disable that capability, so I needed to do some digging.

    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 can 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...

    I fired up my favourite search engine, and came across this posting from Microsoft: How to enable the "Use Predefined Table Format" setting when you use a Windows SharePoint Services template in SharePoint Server 2007. 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.

    I checked the master pages and page layouts that PublishingLayouts feature use, and note that there is not a reference to that CSS. Nor is it in the page layouts found in the PublishingResources feature. What gives? What's the correct syntax?

    No matter. I'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't get into here), I quickly realized that this would not work in my scenario (Canadian English is not 1033) either.

    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 speficy the full path, like this example taken from BlueBand.master:

    • <SharePoint:CssRegistration name="<% $SPUrl:~sitecollection/Style Library/~language/Core Styles/controls.css %>" runat="server"/>
    but instead I needed simply this:
    • <SharePoint:CssRegistration name="HtmlEditorTableFormats.css" />
    and SharePoint takes care of the rest, building out the path to the appropriate Styles as required, like this:
    • <link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/Htmleditortableformats.css?rev=guYGdUBUxQit03E2jhSdvA" />

    Here is a great post which talks about what's going on, and what rendres 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() . <groan! />


Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts