Setting custom SharePoint item new/edit/view pages

In my last article I looked how you can customize the masterpage of SharePoint list item form pages (edit/view/new). This is particularly helpful when you need to create a print view for display.aspx or have additional webpart zones and webparts on your edit page. In this article we`ll take a look at how we can associate our custom pages as a default pages for lists that are created.

Assuming we already have a custom page for NewItem and EditItem, here is how we`re going to define them when creating a list, inside feature.xml:

<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>
<ListTemplate
Name=”MyTemplate”
Type=”2100″
BaseType=”1″
OnQuickLaunch=”TRUE”
SecurityBits=”11″
DisplayName=”My Custom List Type”
NewPage=”MyCreateList.aspx”
EditPage=”MyEditList.aspx”
Description=”My description…”
Image=”/_layouts/images/itsl.gif”
DocumentTemplate=”100″>
</ListTemplate>
</Elements>

<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>

<ListTemplate

Name=”MyList”

Type=”2100″

BaseType=”1″

OnQuickLaunch=”TRUE”

SecurityBits=”11″

DisplayName=”My Custom List”

NewPage=”MyNewList.aspx”

EditPage=”MyEditList.aspx”

Description=”My description…”

Image=”/_layouts/images/itsl.gif”

DocumentTemplate=”100″>

</ListTemplate>

</Elements>

In this case when the list is created it will use our own MyNewList.aspx and MyEditList.aspx to handle the logic.

Here is some additional information from MSDN on the topic.

This entry was posted in MOSS, sharepoint and tagged , , , . Bookmark the permalink.

Comments are closed.