SharePoint Study Notes-site definition series-6. Create a list instance based on a deployed list template

Source: Internet
Author: User

When we create list instances and List Templates, they are all in a soltuion. If other members of our development team have developed and deployed some List Templates, now we need to use the developed list template in our new solution to create our list instance. How can we operate it? Here we take the list template in the custom list definition we created earlier as an example to create a new list instance.
First, use vs2010 to create an empty ingress poin Project (farm mode)

Add an empty element to the new project.

Create a project as follows:

In elements. XML, enterCodeAs follows:

<? XML version = "1.0" encoding = "UTF-8" ?>
< Elements Xmlns = "Http://schemas.microsoft.com/sharepoint" >
< Listinstance Title = "Mypiclistfromtemplate"
Featureid = "F4ea6583-56a3-4328-90b2-c3b4a62afad4"
Templatetype = "10006"
ID = "Mypiccustomlist"
Description = "The list instance from list template ."
URL = "Lists/mypiccustomlist"
Onquicklaunch = "True"
Rootwebonly = "False"   />
</ Elements >

This listintance is created based on an existing list template. In its definition, there are two key attributes.
Featureid:Some people will confuse this attribute and think it is the ID of the feature where the list definition we deployed previously is actually not. This featureid is the ID of the custom list template provided by the system after the deployment.
Templatetype:This attribute must be consistent with the type value of custom content type. This attribute value is in frontArticle.
Then you may have to ask, how do I know the featureid and templatetype values? Use our serverexplorer to open serverexplorer in vs2010 and find the list template we need, view its attributes. In the attribute description, we can find the attribute values that we need to use.

Project operation diagram:

After build and deployment, you can see the list instance we created.

 

Of course, in addition to the user-defined list template, we can also use the list template created by the system to create our list instance.

The following table lists valid List Templates and Their templateid and featureid.


Type of list

Templateid

Featureid
Generic list 100 00bfea71-de22-43b2-a848-c05709900100
Document Library 101 00bfea71-e717-4e80-aa17-d0c71b360101
Survey 102 00bfea71-eb8a-40b1-80c7-506be7590102
Links list 103 00bfea71-2062-450c-90bf-714c59600103
Announcements list 104 00bfea71-d1ce-42de-9c63-a44004ce0104
Contacts list 105 00bfea71-7e6d-4186-9ba8-c047ac750105
Events list 106 00bfea71-ec85-4903-972d-ebe475780106
Tasks list 107 00bfea71-a83e-497e-9ba0-7a5c597d0107
Discussion list 108 00bfea71-6a49-43fa-b535-d15c05500108
Picture Library 109 00bfea71-52d4-45b3-b544-b1c71b620109
Data sources 110 00bfea71-f381-423d-b9d1-da7a54c50110
Site template Gallery 111
User Information List 112
Web Part Gallery 113
List template Gallery 114
XML form library 115 00bfea71-1e1d-4562-b56a-f05371bb0115
Master pages Gallery 116
No-code workflows 117 00bfea71-f600-43f6-a895-40c0de7b0117
Custom workflow process 118 00bfea71-2d77-4a75-9fca-76516689e21a
Wiki page Library 119 00bfea71-c796-4252-9f2f-0eb9a6e71b18
Grid list 120 00bfea71-3a1d-41d3-a0ee-651d11570120
Data Connection Library 130 00bfea71-dbd7-4f72-b8cb-da7ac0440130
Workflow history 140 00bfea71-4ea5-48d4-a4ad-305cf7030140
Gantt task list 150 00bfea71-513d-4ca0-96c2-6a47775c0119
Meeting series list 200
Meeting Agenda list 201
Meeting attendees list 202
Meeting demo-list 204
Meeting objectives list 207
Meeting things to bring list 211
Meeting Workspace pages list 212
Blog posts list 301
Blog Comments List 302
Blog categories list 303
Status Indicator (KPI) List 432 7ed6cd55-b479-4eb7-a529-e99a24c10bd3
Report Library 433 6e53dd27-98f2-4ae5-85a0-e9a8ef4aa6df
Publishing pages Library 850
Issue tracking list 1100 00bfea71-5932-4f9c-ad71-1557e5751100
Administrator tasks list 1200
Translation Management Library 1300 29d85c25-170c-4df9-a641-12db0b9d4130
Translation list 1301 29d85c25-170c-4df9-a641-12db0b9d4130
Slide Library 2100 0be49fe9-9bc9-409d-abf9-702753bd878d

 

Take generic list template as an example to create a list instance. You only need to add the following definition to elements. XML in the above project:

< Listinstance Title = "Mygenericlistfromtemplate"
Featureid = "00bfea71-de22-43b2-a848-c05709900100"
Templatetype = "100"
ID = "Mygenericcustomlist"
Description = "The list instance from generic list template ."
URL = "Lists/mygenericcustomlist"
Onquicklaunch = "True"
Rootwebonly = "False" />

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.