In this example, we have two custom content types based off the Event list content type: (1) “Event Type 1”, with single line text fields “Column A” and “Column B”, and (2) “Event Type 2”, with single line text fields “Column Y” and “Column Z”. Create a Calendar, “Sample Calendar”, and add these two content types to the list. After creating an event of both content types, we see that the add, edit, and display forms all act as we would hope – only columns in that content type appear.
2012-08-29-CustomViews-01.png
Figure 1 – Add/Edit Event Type 1
2012-08-29-CustomViews-02.png
Figure 2 – Add/Edit Event Type 2
2012-08-29-CustomViews-03.png
Figure 3 – View Event Type 1
2012-08-29-CustomViews-04.png
Figure 4 – View Event Type 2
However, we may not need the Category, All Day Event, Recurrence, or Workspace columns. In this example, we want to remove them from the views. Open SharePoint Designer 2010, open your site, and click on the list. On the right, there is a section for Forms.
2012-08-29-CustomViews-05.png
Click New… and create a new item form that is and use the content type Event Type 1.
2012-08-29-CustomViews-06.png
Now this form will appear in the Forms panel.
2012-08-29-CustomViews-07.png
Click nf1.aspx to edit the form. From the split view, find the table row tags containing the columns you want to delete and remove these lines from the page. Set this as the default New Form page, and create a new Event Type 1 event. Creating an event of Event Type 1, it seems all is set.
2012-08-29-CustomViews-08.png
However, now when we go to create an event of Event Type 2, we get the same new form as in Event Type 2. We need to create a new form for Event Type 2 in the same way we did for Event Type 1 above.
If we set this new form to be the default, we run into the same issue when we try to create an event of Event Type 1. To resolve this, we need to associate the form with the content type itself, not with the list. Click on the sample calendar in SharePoint Designer. At the bottom left, there is a panel for Content Types.
2012-08-29-CustomViews-09.png
Click on our content type Event Type 1. On the top right, there is a panel for Forms.
2012-08-29-CustomViews-10.png
Click the section for New Form to enter the URL of our custom new form, enter the URL, hit Enter, and save your changes.
2012-08-29-CustomViews-11.png
Do the same for Event Type 2. Now when we try to add an event of each content type, we get the appropriate new forms.
2012-08-29-CustomViews-12.png
Figure 5 – Custom New Form for Event Type 1
2012-08-29-CustomViews-13.png
Figure 6 – Custom New form for Event Type 2
Repeat the same steps for the Edit and Display forms to complete the custom views.