Musings on code and stuff RSS Feed


Calendar Content Types in SharePoint 2007
For a non-profit parenting organization like PRAM, the calendar means everything. They have monthly board meetings, weekly playgroup schedules, classes, workshops, holiday parties, and other programs going on all the time. The Calendar List in SharePoint 2007 is the perfect solution since it allows for both one-time and recurring events, just like Outlook. However, meetings, playgroups, and programs each have different attributes (or columns). For example, playgroups need to track the playgroup leader and the leader's contact information, while classes need to track information about the teacher, fees, and discounts, none of which is provided by default in the list. So, how can I set up my calendar lists to support multiple types of events? I could add a superset of columns to the default list, but then I would have to think about the non-applicable columns every time I added/edited an event. Alternatively, I could create a different list for each type of event, but then users would have to check each calendar to make sure they weren't double-booking a location, or scheduling two important events at the same time. The obvious answer is to use a single calendar list, and use the built-in content type functionality in SharePoint 2007, which allows you to support multiple types in a list. I could go on forever about it, but you can read more about content types here. In PRAM, here's what all this looks like: This is exactly what we want, three different content types in one calendar: Event, Playgroup, and Program. Users can store all of their data in one calendar and just add different views for different visualizations of the data. For example, I added an All Programs view that has a filter on the Program content type. But wait, there's a catch! Although content types are supported in calendar lists, in order to be useful, they should inherit the built-in Event content type. This allows them to support recurrence and other nice features of events. Unfortunately, SharePoint hides the Event content type in a special content type group named "_Hidden". As you might have correctly guessed, you can't inherit from hidden content types because you can't see/access them via the SharePoint interface by default. To get around this limitation, follow these steps: Make a backup of this folder: [Drive]:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\ctypes\ In the ctypeswss.xml file, find the section beginning with stsadm -o deactivatefeature -filename "ctypes\feature.xml" -url http://[Application][Drive]:\>stsadm -o activatefeature -filename "ctypes\feature.xml" -url http://[Application] This un-hides the Event content type and places it in the List Content Types group under your Site Content Type Gallery. Now you are free to use the Event content type as a parent for your new content types! Once you are done, you can re-hide the Event content type by replacing the ctypes folder with the backup from Step 1, or by following the above steps again, but swapping the two groups in Step 3. Good luck!
 
Posted by Will Allan | 17 Comments | Trackback Url | Bookmark with:        
Tags: SharePoint 2007

Links to this Post

Comments

Thursday, 10 May 2007 02:25 by Still not showing
Thanks for posting this. I too would like to extend Events rather than create a custom event content type from scratch.   I tried the above. The operation was successful (or so it responded) but still not showing. Any suggestions on where to look? Sorry for being a vague question.   We are running a farm with two front end and a third Central Admin server. I tried it on all three.   Thanks for your help.    

Wednesday, 23 May 2007 12:26 by Re:Still not showing
Try restarting IIS.. that did it for me.

Sunday, 10 Jun 2007 09:19 by Item Site Content Type
Hi BY mistake I have change the name of the Title field in my Item Content type. Any Idea on how to change it back to Title. When I try it gives me an error that the name is reserved..Thanks P

Monday, 30 Jul 2007 05:27 by Hide the Workspace Column
Hi there,   Great tip, thanks, it worked like a charm and is exactly what I needed.   Would you know how to go about hiding the Workspace option from users so that they do not have that option.   Thanks in advance.

Wednesday, 1 Aug 2007 11:23 by Item Site Content Type
Item Site Content Type Hi BY mistake I have ALSO change the name of the Title field in my Item Content type. Any Idea on how to change it back to Title. When I try it gives me an error that the name is reserved.. mark.ashdown@thamesidefire.co.uk Please Help it has stopped my sharepoint in its tracks! Thanks in advanced Mark A

Friday, 24 Aug 2007 12:57 by Brilliant technique...
I had the same problem and there is absolutely no documentation on doing things like this. Its almost like Microsoft makes it hard for you to use the product fully. WTF

Tuesday, 11 Sep 2007 02:00 by Hide workspace check box
Hi.  Any ideas on how to hide the workspace check box in the new & edit forms of calendar event items?  Thanks

Thursday, 13 Sep 2007 05:27 by Hiding workspace option
The workspace option on NewForm.aspx and EditForm.aspx can be hidden by applying the ShowInEditForm and ShowInNewForm attributes (both set to FALSE) to the Workspace and WorkspaceLink field definitions in the Events list's schema.xml file (...\TEMPLATE\FEATURES\EventsList\Events\schema.xml). Of course, be sure to deactivate, unload, load and activate the feature using stsadm to apply the changes then do an iisreset (or perhaps just recycle MOSS's app pool).

Sunday, 16 Sep 2007 10:37 by Non-coding way to unhide the Event content type
Hi. I'm more of an advanced user than Sharepoint developer, but I managed to unhide the 'Event' content type so I could use it to make another content type based on it (without any coding): 1. Go into the 'List settings' for an existing calendar on your site 2. Click on 'Advanced Settings' and tick yes for "Allow Management of Content Types" 3. This then shows the 'Event' content type in that calendar's List Settings. 4. Click on the word 'Event' in the list of content types. 5. At the top of the next page it tells you that the parent is also called 'Event' - click on its link. 6. The following page tells you that the parent content type is in Group "_Hidden". 7. Click on the "Name, Description & Group" link and then it allows you to put the 'Event' content type into a new group. I put it into "List Content Types". Voila! If I then go to create a new content type, the Event content type is selectable (under the parent of List Content Types)

Friday, 28 Sep 2007 12:43 by Where specifically are the Workspace and WorkspaceLink field definitions located in the schemas.xml file
I have the schemas.xml file open for the events list and see that it references WorkSpace and WorkSpaceLink in many places.  Can you tell me the where exactly in this file i need to add the ShowInEditForm and ShowInNewForm attributes (both set to FALSE)? Great tip by the way! Thanks

Friday, 23 Nov 2007 11:53 by Great post and even better comments!
Great post and even better comments!   I was about to give one of our Dev's a call to see if he could follow this blog to enable it for me....   Then I read all the comments, I was able to edit the event content type w/ no filesystem editing.   Always easier to do through advanced settings than other advanced ways.... Thanks everyone!

Monday, 10 Dec 2007 02:22 by Showing up but in wrong group
Hi,   first of all: great post: exactly what I was looking for.   However, after unhiding, my content type appears in a group called: $Resources:List_Content_Types. For one reason or another, the group name isn't translated. My site isn't set up in English: it is a site set up in Dutch. Could that be the reason. If so: how to solve this?   Also, it is not for the ctypes, but for the tsatypes (the ones coming with the 40 fantastic templates.  

Friday, 28 Dec 2007 03:32 by Program director
 I work for a small nonprofit and we are using sharepoint 2003 to create an online calendar that will let us track various responsibilities on our staff. I built a shared calendar with the fields such as: what is the task when is it due how often it repeat when is it completed   I also made categories so that I could tell what tasks belong to administration vs. program vs. IT vs. Fundraising vs. Finance. The problem is that I want to filter for one category, say program, but then I can’t seem to rebuild the calendar with only those records (tasks) that are program items.   When the calendar page is rebuilt, it includes every single task and the filtering is all forgotten. Is that a feature fixed in the new version or is there something I am missing? thanks

Tuesday, 15 Jan 2008 06:35 by How to hide the workspace solumn in calendar through javascript
open the NewForm.aspx of the calendar in sharepoint designer and add the javascript code after this code   <script id="onetidPageTitleAreaFrameScript"> document.getElementById("onetidPageTitleAreaFrame").className="ms-areaseparator";</script>  and save it:   <script> var Toolbar = document.getElementById("<id of workspace>");Toolbar.parentNode.parentNode.parentNode.style.display = "none";Toolbar.parentNode.parentNode.style.display = "none"; </script>   with this we can retain the recurrence and all day event option for event content type.

Friday, 25 Jan 2008 02:57 by How to validate or avoid a calendar booking on same date and time
Hi, I have used calender in sharepoint 2007 site for discussion room booking. If there is a booking at 9am to 9.30am on 25/1/2008, and if anyone who tries to book at same time and date, I need to validate or give message that this slot is booked. How can I do this? Kindly Help.   Thanks Vinay

Tuesday, 29 Jan 2008 09:02 by How to "delete" Recurrence and Workspace?
Hi, Thank you for the post :-) I used the Event content type for my custom events... But now I would like to remove Recurrence and Workspace fields from my customized content type... but these fields cannot be deleted from the content type. Someone can help? Thanks Marco

Thursday, 28 Feb 2008 11:51 by Sweet!
Thanks alot.

Name:
URL:
Email:
Comments:

CAPTCHA Image Validation