<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Cliff Green's Blog : Features</title><link>http://blogs.msdn.com/cliffgreen/archive/tags/Features/default.aspx</link><description>Tags: Features</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Finding a SharePoint List Template Id</title><link>http://blogs.msdn.com/cliffgreen/archive/2008/08/04/finding-a-sharepoint-list-template-id.aspx</link><pubDate>Mon, 04 Aug 2008 16:11:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8831024</guid><dc:creator>green.cliff</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/cliffgreen/comments/8831024.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cliffgreen/commentrss.aspx?PostID=8831024</wfw:commentRss><description>&lt;p&gt;There are several ways to find out the ID for a List.&amp;nbsp; A typical scenario where a list template id is required is querying a list or set of lists using SPSiteDataQuery.&amp;nbsp; You can find the list template id by looking at the 12\TEMPLATE\FEATURES directory and finding the list in question.&amp;nbsp; Opening the element manifest for the feature you will notice an attribute named DocumentTemplate, which is the List Template ID or Type which will provide the list template type, also ID for the out of box templates.&lt;/p&gt; &lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #800000"&gt;xml&lt;/span&gt; &lt;span style="color: #ff0000"&gt;version&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="1.0"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;encoding&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="utf-8"&lt;/span&gt; ?&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; 
&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Elements&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="http://schemas.microsoft.com/sharepoint/"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ListTemplate&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="doclib"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="101"&lt;/span&gt; 
    &lt;span style="color: #ff0000"&gt;BaseType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="1"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;OnQuickLaunch&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="TRUE"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;SecurityBits&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="11"&lt;/span&gt; 
    &lt;span style="color: #ff0000"&gt;Sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="110"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DisplayName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="$Resources:core,doclibList;"&lt;/span&gt; 
    &lt;span style="color: #ff0000"&gt;Description&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="$Resources:core,doclibList_Desc;"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Image&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="/_layouts/images/itdl.gif"&lt;/span&gt; 
    &lt;span style="color: #ff0000"&gt;DocumentTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="101"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; 
&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Elements&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Another method to do this leveraging the UI is to click Site Actions &amp;gt; Create.&amp;nbsp; The next screen provides a view of all the lists and document libraries that can be created on the site.&amp;nbsp; If you right click the list and select properties you will be presented the Url Address for the list.&amp;nbsp; Highlighting and scrolling to the end of the Url you will see a query string variable called ListTemplate.&amp;nbsp; The value presented is the list template ID.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/cliffgreen/WindowsLiveWriter/FindingaSharePointListTemplateId_7209/image_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="212" alt="image" src="http://blogs.msdn.com/blogfiles/cliffgreen/WindowsLiveWriter/FindingaSharePointListTemplateId_7209/image_thumb_1.png" width="358" border="0"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;A more dynamic method of finding this information in code is to leverage the object model.&amp;nbsp; SPWeb has a property called ListTemplates that returns a collection of the lists that can be created on the site.&amp;nbsp; The SPListTemplate class held in the collection has a property called DocumentTemplate property providing the List Template ID. &lt;/p&gt;
&lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt;( SPSite siteCollection = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SPSite(&lt;span style="color: #006080"&gt;"http://moss.litwareinc.com"&lt;/span&gt;) ) {
  &lt;span style="color: #0000ff"&gt;using&lt;/span&gt;( SPWeb web = siteCollection.OpenWeb() ) {
    &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt;( SPListTemplate template &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; web.ListTemplates ) {
      Console.WriteLine(template.DocumentTemplate.ToString());
    }
  }
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Another little known method for getting the ID, at least for those features that are out of the box, is to use the feature GUID, which has a format of OOBFxxx-xxxx-xxxx-xxxx-xxxxxxxxx101.&amp;nbsp; For example, the listing for a document library is &lt;strong&gt;00BF&lt;/strong&gt;EA71-E717-4E80-AA17-D0C71B360&lt;strong&gt;101&lt;/strong&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8831024" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cliffgreen/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/cliffgreen/archive/tags/Features/default.aspx">Features</category></item></channel></rss>