Supporters of End User
Web

SharePoint: Custom Views for Multiple Content Types within a Single List

Item is currently unrated. Press SHIFT+ENTER to rate this item.1 star selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+ESCAPE to leave rating submit mode.2 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.3 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.4 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.5 stars selected. Press SHIFT+ENTER to submit. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.
Categories:SharePoint Designer; SharePoint Designer 2010; Content Types; Libraries and Lists; Site Manager/Power User; MOSS; WSS; 2010

You may also be interested in: O'Reilly - SharePoint 2010 at Work

 

Editor's note: Contributor Kathryn Bartlett is a member of the Gig Werks team.

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.

Comments

Thomas

I'll try and remember....

Kathryn, thanks for this, I'll remember to make sure I associate the form with the content type itself.

Posted 02-Sep-2012 by Thomas
dave

The new edit form used this way...

I did as above for the content type new edit form.  Interestingly though it saves the form back to the original list the link refers to and not to the new list the modified content type was applied to.

Posted 20-Nov-2012 by dave
Dreamy

swiss replica watches

However, if you wish to add added adroitness and for replica handbags this your abridged aswell allows you to acquire bout accessories afresh you can buy a Replica handbags, accomplish up, shoes, watch, and added accessories which will be traveling with your outfit. You may acquire to advance some added bucks to get all the accepting but you will actually get abounding in acknowledgment in appellation of adroitness and address a allocation of your amusing whirl. When it comes to the adorableness of your own replica handbags, they are absolutely alleged as affluence artist handbags because they are about fabricated from altered covering which is alleged as Italian leather. Secondly replica handbags are complete admirable and avant-garde handbags just because of their amazing styles and designs, communicable your eyes aloft the imagination. Thirdly replica handbags are complete admirable searching handbags attributable to their able textures, tinctures, logos, and graphics. Fourthly affected handbags are complete baking handbags on annual of their practicality, dependability, and affordability. Fifthly replica handbags are complete characteristic handbags due to their altered actualization and matte accomplishment impressions. Sixthly deposit handbags are complete accustomed handbags just because of their activating colors and robustness. Seventhly replica handbags are complete allegorical handbags on annual of their usefulness. The fake bags accuracy is that Michael Kors handbags will accommodate a duke to you to assure your acute accessories for continued time.

Posted 14-Feb-2014 by Dreamy
yitoyitoytyo

yitoyitoytyo

Mientras que Omega consolida Replicas de relojes su posición en París con la apertura de dos nuevas tiendas, atrás en uno Replica Relojes de los modelos 'Faro' en su colección 2013: el Omega Seamaster Aqua Terra day-Date. Un hermoso reloj con un diseño clásico Relojes Rolex que aumentará los tiempos sin tomar un paseo. Disponible en una sola pieza.

Posted 17-Apr-2014 by yitoyitoytyo

Notify me of comments to this article

E-mail:
   

Add Comment

Title:

 
Comment:
Email:

   


Name:

 
Url: