SharePoint Custom List with Custom Content Types and Custom Display Forms
I recently ran into an issue with using multiple content types on a custom list in SharePoint. I wanted each content type to have its own custom display form (DispFormCustom1.aspx, DispFormCustom2.aspx, etc.). Using SharePoint Designer (SPD), you can right-click on the list, open the list properties, and view the
tab to select a page for each content type. However, there is a trick to getting different content types to use different custom forms.The Wrong Way
- With your site open in SPD, open the properties of the list with your custom content types and custom forms by right-clicking on the list in the Properties,” then go to the tab. pane and selecting “
- Choose the first content type from the Content type specific forms drop-down menu.
- Click on Display item form field and choose “DispFormCustom1.aspx” (or whatever you named your custom form). You’ll have to browse to the Lists folder, and then into the folder for the list itself if that’s where you created your custom form. for the
- Click , then click .
- In the browser, go to the list and test by viewing an item of that content type. It looks great! If you haven’t already, create a test item for each of the content types so you can view them while testing.
- Go back into SPD and repeat this process for each custom content type.
The problem I encountered is that all of my content types would be reset to use the default content type’s display form as soon as I clicked
. After a lot of searching, browsing forums, and testing, I figured out how to get this to work by adding a few additional steps.The Right Way
- With your site open in SPD, open the properties of the list with your custom content types and custom forms by right-clicking on the list in the Properties,” then go to the tab. pane and selecting “
- Choose the content type that is currently set as the default content type from the Content type specific forms drop-down menu. The default content type is not always the first option in the drop-down menu; the menu is sorted alphabetically, so the default content type could be first, last, or anywhere in between (check your list settings in the browser to find out which content type is set as the default).
- Click on Display item form field and choose “DispFormCustom1.aspx” (or whatever you named your custom form). You’ll have to browse to the Lists folder, and then into the folder for the list itself if that’s where you created your custom form. for the
- Click , then click .
- Close SharePoint Designer.
- In the browser, go to the list and test by viewing an item of that content type. It should be using the custom form now.
- While still in the browser, go to the list settings page and set a different content type to be the default (click on the
Content type settings are accessible on the list settings page. Click the "Change new button order and default content type" link.
link, set the next content type to number 1, then click ).
- Open SharePoint Designer (you did close it after setting the Display item form field for the first content type, right?) and repeat steps 1-7 for each additional content type that you want to use with a custom form.
I realize the process outlined above is cumbersome, but this is the only way I’ve been able to ensure that all of my content types can use their own custom display form without running into issues with resetting all of the content types to the same form. If anyone has additional tips on this behavior, let me know in the comments!
Comments
/Lists/YourList/DispForm.aspx?ID=1
and your second would be/Lists/YourLists/DispForm.aspx?ID=2
. If you've created a custom display form, make sure that it's using the ID parameter correctly to determine which item to display.Comments are closed