<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Welcome to Shantha Kumar&#039;s Blog &#187; ContentType</title>
	<atom:link href="http://www.ktskumar.com/blog/tag/contenttype/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ktskumar.com</link>
	<description>more points 2 share - Sharepoint</description>
	<lastBuildDate>Sat, 28 Aug 2010 02:13:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Manage Content Types on New Button</title>
		<link>http://www.ktskumar.com/blog/2010/02/27/manage-contenttypes-on-new/</link>
		<comments>http://www.ktskumar.com/blog/2010/02/27/manage-contenttypes-on-new/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 08:38:25 +0000</pubDate>
		<dc:creator>ShanthaKumar</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[ContentType]]></category>
		<category><![CDATA[Disable]]></category>
		<category><![CDATA[Enable]]></category>
		<category><![CDATA[UniqueContentTypeOrder]]></category>
		<category><![CDATA[Visible]]></category>

		<guid isPermaLink="false">http://ktskumar.com/blog/2010/02/27/contenttype-visible-enable-disable-uniquecontenttypeorder/</guid>
		<description><![CDATA[SharePoint Lists are enabled with multiple content types, because of that we can add items with different type of properties and documents. In advanced, the New Menu displays those Content type available in List as its sub-menu. Fig1 Content Types Visible in New Menu So how the SharePoint displays those Content types under New menu]]></description>
			<content:encoded><![CDATA[<p>SharePoint Lists are enabled with multiple content types, because of that we can add items with different type of properties and documents. In advanced, the New Menu displays those Content type available in List as its sub-menu.</p>
<p align="center"><a href="http://www.ktskumar.com/wp-content/uploads/2010/02/image1.png"><img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" border="0" alt="image" src="http://www.ktskumar.com/wp-content/uploads/2010/02/image_thumb1.png" width="265" height="146" /></a> </p>
<p align="center"><em><font color="#808080">Fig1 Content Types Visible in New Menu</font></em></p>
<p>So how the SharePoint displays those Content types under New menu and how we can enable and disable those content types under that new Menu.</p>
<p>So here is the simple snippet to list out the content types enabled in New Menu.</p>
<blockquote><p>SPList list = web.Lists[&quot;ListName&quot;];</p>
<p>IList&lt;SPContentType&gt; ctoFolder = list.RootFolder.UniqueContentTypeOrder; </p>
<p> foreach (SPContentType ctype in ctoFolder)    <br />{    <br />&#160;&#160;&#160; Console.WriteLine(ctype.Name);    <br />}</p></blockquote>
<p>UniqueContentTypeOrder of SPFolder member lists out the Content Types visible on New Menu. Now we&#8217;ll see the code for removing the ContentType on New menu.</p>
<blockquote><p>SPList list = web.Lists[&quot;ListName&quot;]; </p>
<p>IList&lt;SPContentType&gt; ctoFolder = list.RootFolder.UniqueContentTypeOrder; </p>
<p><font color="#21b628">//Code for removing the Content Type sub-menu in New Menu.</font></p>
<p><font color="#21b628">//Removing the &quot;Test Content Type&quot; menu under New Menu</font></p>
<p>for (int i = ctoFolder.Count &#8211; 1; i &gt;= 0; i&#8211;)     <br />{      <br />&#160;&#160;&#160; if (ctoFolder[i].Name == &quot;Test Content Type&quot;)      <br />&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ctoFolder.Remove(ctoFolder[i]);&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160; }&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />} </p>
<p>list.RootFolder.UniqueContentTypeOrder = ctoFolder;     <br />list.RootFolder.Update();</p>
<p><font color="#21b628">//Code for adding the Content type sub-menu under New Menu</font></p>
<p><font color="#21b628">//Adding the &quot;Test Content type&quot; menu under New Menu</font></p>
<p>SPContentType ctype = list.ContentTypes[&quot;Test Content Type&quot;];&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />ctoFolder.Add(ctype);      <br />list.RootFolder.Update();</p>
</p>
</blockquote>
<p>The above helps us to enable and disable the Content type on New Button in SharePoint List.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ktskumar.com/blog/2010/02/27/manage-contenttypes-on-new/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SP2010 &#8211; Tips &amp; tricks 1</title>
		<link>http://www.ktskumar.com/blog/2010/02/13/sp2010-tips-tricks-1/</link>
		<comments>http://www.ktskumar.com/blog/2010/02/13/sp2010-tips-tricks-1/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 12:45:52 +0000</pubDate>
		<dc:creator>ShanthaKumar</dc:creator>
				<category><![CDATA[SharePoint Tips]]></category>
		<category><![CDATA[SharePoint-2010]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[ContentType]]></category>
		<category><![CDATA[SP2010 Tips]]></category>

		<guid isPermaLink="false">http://ktskumar.com/blog/2010/02/13/sp2010-tips-tricks-1/</guid>
		<description><![CDATA[Hello guys, few weeks I had a busy schedule, so I can&#8217;t concentrate on blogging. Now I&#8217;m back with more ideas to be shared with you all. Here I&#8217;m going to give you a simple snippet of &#34;Retrieving the content type enabled lists&#34; from the site using Client Object Model. &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ClientContext context = new]]></description>
			<content:encoded><![CDATA[<p>Hello guys, few weeks I had a busy schedule, so I can&#8217;t concentrate on blogging. Now I&#8217;m back with more ideas to be shared with you all.</p>
<p>Here I&#8217;m going to give you a simple snippet of &quot;Retrieving the content type enabled lists&quot; from the site using Client Object Model. </p>
<blockquote><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ClientContext context = new ClientContext(&quot;<a href="http://localhost");">http://localhost&quot;);</a>      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Web web = context.Web; </p>
<p><font color="#21b628">&#160;&#160; <em>//Load all the lists from web</em></font>      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ListCollection listCollection = web.Lists;&#160;&#160;&#160;&#160; <br />&#160;&#160; <font color="#21b628"><em>//Filters the lists has the content type enabled</em>        <br /></font>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; context.Load(listCollection,       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; lists =&gt; lists      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; .Include(list =&gt; list.Title)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; .Where(list =&gt; list.ContentTypesEnabled)&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; );      <br />&#160;&#160; <em> <font color="#21b628">//Execute the Query</font></em>      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; context.ExecuteQuery();&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Console.WriteLine(&quot;Lists enabled with ContentType:&quot;);      <br />&#160; <font color="#21b628">&#160;<em>//Print the Content type enabled lists</em>        <br /></font>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; foreach (var list in listCollection)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Console.WriteLine(list.Title);      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
</blockquote>
<p>The above code only returns the List collection from particular web, those are content type enabled. Next time, I&#8217;ll back with another interesting SP2010 snippet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ktskumar.com/blog/2010/02/13/sp2010-tips-tricks-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
