Monday, September 18, 2006

The cursed Site Directory Template in MOSS!

wow...been a long day batteling against the site directory site template. I filled so many bug reports I will have to go through the store tommorrow and get some bug spray!
Let me start from the beggining.

The "site directory" site template is a great template with some features to catalog sharepoint sites. It includes a large "create site" button on the top of the page, and has a "sites" list that holds the links to the sites created through the "create site" link, and stores meta data on them.

So I had an idea - create a new site collection with the root as a site directory, change the name "create site" to "create project" (since my customer wanted to create project sites - nothing to do with project management...long story, but project server is out of the question) and ask the user to add custom meta data on the "project" he is creating.

Well - happily Microsoft realised this was something sharepoint 2003 lacked, and are trying to fix it. When you edit the "sites" list, and add custom fields - the site creation page shows you those fields when you open the "create site" page.
bug number One
Site directory as the root site? go figure!
Apperantly no one thought that the site directory template would be used as a root site in the site collection. otherwise, how do you explain the fact that the "create new site" button is rendering a wrong link when the template is used that way.
instead of writing the link as "/_layouts/newsbweb.aspx" it renders "//_layouts/newsbweb.aspx". This one should go directly to www.thedailywtf.com.

bug number Two
Complex controls? who wants that?
so you wanted a field called "due date". and you wanted that to be (hold your breath) of type date. you didnt expect the date picker control, did you?
...
oh, you did. pity. date fields are rendered as text boxes in the create site dialog.
And you created a lookup with a multiple selection enabled. so what?! you will still get the look up field rendered as a combobox (allowing only one item to be selected). and say thanks its not a text box like the dates!

bug number Three
Still with the custom fields. So I wanted to force a user to fill in one of the fields. is that too much to ask? but no...validation doesnt work on the cursed page.

bug number Four
Did i mention the fact that I added a lookup to another list, and set it to allow multiple selection in the "sites" list? I am sure I did. Such a scenario is probably to far-fetched, since when you fill in some data in the list, you suddenly see in the list view web part strange text next to every selection in that field: "<!-- #RENDER FAILED -->"
I wonder what thats about...

bug number Five
You have got to be kidding me!, web part communication? with a list called "sites" in a site directory template? what are you talking about???
Well - you can connect two web parts, and have one of them be the "sites" web part, and even have that one as the receiver.
but...
if the receiver "sites" web part only shows one field (the title field) I got a nice looking error: "web part error: web part sites did not implement the GetInitEventArgs".
Add another field, and viola! web part connection works again.

bug number SIX SIX SIX!
Oh, you expected sharepoint to actually store the metadata? how bizzare!
yep - what ever you do, the site meta data isnt added to the "sites" list. so long site directory.

I think I'm going to lay down for a while. tomorrow I am going to develop my own site directory list.

oh, wait - I forgot - I tried that today using the event handlers. and guess what? The bug where "itemadding" event doesnt give access to the item properties is still there. So I cant catch the event of an item being added to the "sites" list and create a site based on the metadata. I will have to create my own aspx page to do it, and update the list.

I have an feeling this isnt going to be my week...Hey Microsoft - if I had wanted to be a developer I wouldnt have become a...errr...never mind, I guess it is my job to do workarounds (-:

Update
A lot of people are asking about how it is in RTM. Well, dont bother - I contacted microsoft about this during Beta, and they acknowledged that this is a known issue and the "site directory template was not meant to work like that".
Bummer.

8 comments:

Renaud Comte said...

Hi

Just a question : do you test this on the Beta 2 or on a TR version ?

I speak about issue 6 (metadata)

I ve seen a bug very strange when you use a site directory into "Site collection" mode
http://blog.funknstyle.com/?p=529

Thanks in advance

Anonymous said...

Yeah I have the exact question about this, were these all found on Beta 2, or TR ?

Morgan said...

Great blog post, I have had some problems with this as well.

Did you test this in Beta 2, and always in TR?

We created a custom web part to do this in WSS v2, and I think we will continue to use it.

I don't think you would want to add a site in an event handler, because of how long it could take.

Send me an email, and I can tell you more about how we did our web part, and how we are using it in MOSS 2007.

Ishai Sagi said...

I tested this both on beta 2 and on TR.

Maverick Coder said...

Hi,

When i add some fields to site directory it gets added and can be seen in 'Create site' page. Also site metadata can be added in 'Sites' list. But when the field is 'look-up' then no matadata is added to the 'Sites' list!!!

am i missing any configuration stuff or its just a bug?

Anonymous said...

Hello,

Did you ever solve any of these issues with the release version of MOSS 2007? I am attempting to perform the same type of site collection for projects on the release version and I am also having some issues.

Anonymous said...

Teh "site collection" mode can be used if self-service site management in Central admin. If you do so, then users will be able to create top level site collections under the /sites/ directory structure in sharepoint. It works great with one exeption, the silly "sites" list not automatically populating. Grrrrr!

eva said...

I know how annoying!!