Thursday, June 07, 2007

Customizing Sharepoint 2003, the next step...

Customizing Sharepoint 2003, the next step...

Maybe you saw this other article I posted some weeks ago... after that, my job went on, but eventually I decided - actually my customer decided for me ;-) - to try to use a new site template in order to solve the customization problem I'm facing.

What I have to manage is something I cannot solve "simply" hacking the CSS or modifying the .aspx pages... so I'll try to have a new "MPS" (the WSS Multi Page Site) template different from the original one.

Unfortunately looks like this cannot be done; I managed to "clone" the MPS structure in a new one, but when I go and use it to create a new site I get a series of errors in the WebParts stating that "This Web Part was designed for use on a Microsoft Meeting Workspace". And reading around I found that yes, you can have your site template that originates from another one, but you CANNOT use the Multipage Meeting template as the starting point.

I have to find another way.

I'll try also to share with you the steps I'm taking to do this.

First: I make a copy of the STS directory to a new STSNEW directory. All this happens under
C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\
and as I think that all the action will happen there... I won't repeat that path anymore, for reading simplicity I'll substitute it with [PATH].

So I have this STSNEW! What I do with it?
Uhm... open the [PATH]XML folder, and take a look to the two files:

Interesting stuff!!! So there are the correspondances between folders names and sharepoint usage of the templates...
In my case the interesting one is the WEBTEMP.XML (the WSS one).
First, I make a copy of the file, and name it WEBTEMPSTSNEW.XML.
In it I leave only the "STS" node, renaming it to "STSNEW" (as the containing folder I created before); to this new node I give an ID over 10000 (Microsoft's hint...). Then I change in some way the descritpions, so that later I will be able to choose between the STS and STSNEW styles. Save. Let's see...
No, it's not going well: when I open the main page in Sharepoint I get an "Exception occurred" error, that it's not very esplicative, I'd say. But after a iisreset /restart "magically" Sharepoint is back with us. Good.

Now let's see if our STSNEW can be of any use.
First: I try to create a new WSS site based on this site template.
Everything works fine, I can find in the site structure list the new description I inserted in the XML file, and use those templates to create my site.

So this first part is ok.

Now I have to find a way to "mimic" the tabbed, multipage structure of the "Multipage Meeting Workspace" template here in this "simple" WSS site I created. I'll use the "Team Site" structure (taht in my new site template I named as "New Team Site"), so that I will be able to modify also the the home page (default.aspx).

Let's try this way: create a document library that contains a list of web part pages, so that I can have all the single pages I need. For a good explanation of this, see this blog post from Daniel McPherson.

Then I'll try to create a web part for the "tabbed" navigation.

Maybe I can find something ready on the web... First I try this one from GotDotNet.
Looks great, there is also the code. Downloaded, and installed with the command:
stsadm -o addwppack -f "C:\EasyTabPartsDeployment.CAB" -force -globalinstall

And it works!!!
From now on the path is (more or less) clear: I haev to modify the new site template layout, develop all the new webparts I need, and so on.


No comments: