SharePoint Products TechCenter >
SharePoint Products and Technologies Forums
>
SharePoint - Social Computing
>
SharePoint - WIKI --- Allow Management of Content Types
SharePoint - WIKI --- Allow Management of Content Types
- Can anyone please tell me if the is a method for a Site Admin to "Allow management of Content Types" on a wiki like you would do with a Document Library or a list?
I've built this enormous content type structure only to discover that I cannot use it on the wiki like i would with a document library. I have a massive Wiki and i'm feeling a bit silly to have only discovered this now --- is there ANYTHING that I can do, to introduce my content types that i've created to the wiki?
Thank you
Answers
This capability is not available anywhere in the user interface. However it is possible to enable content types via the object model.
Please keep in mind though that if a feature or functionality is disabled in the user interface then it is typically because it is not supported or could cause issues with other out of the box functionality. For example, I know for a fact that Wiki Libraries do not support folders due to the way that they provide the [[Wiki Link]] functionality.using (SPSite site = new SPSite(url)) using (SPweb web = site.OpenWeb()) { SPList list = web.Lists["Wiki Library"]; list.ContentTypesEnabled = true; list.Update() }
MCTS: SharePoint 2007, Web Applications
MCPD: Web Developer
My Blog: http://corypeters.net- Proposed As Answer byCory Peters Tuesday, August 04, 2009 3:56 PM
- Marked As Answer byLionel Chen - MSFTMSFT, ModeratorFriday, August 14, 2009 4:18 AM
- You need to run the code from a server in the farm.
SharePoint Developer | Administrator | Evangelist -- Twitter -- Blog - http://nextconnect.blogspot.com- Marked As Answer byLionel Chen - MSFTMSFT, ModeratorFriday, August 14, 2009 4:18 AM
All Replies
This capability is not available anywhere in the user interface. However it is possible to enable content types via the object model.
Please keep in mind though that if a feature or functionality is disabled in the user interface then it is typically because it is not supported or could cause issues with other out of the box functionality. For example, I know for a fact that Wiki Libraries do not support folders due to the way that they provide the [[Wiki Link]] functionality.using (SPSite site = new SPSite(url)) using (SPweb web = site.OpenWeb()) { SPList list = web.Lists["Wiki Library"]; list.ContentTypesEnabled = true; list.Update() }
MCTS: SharePoint 2007, Web Applications
MCPD: Web Developer
My Blog: http://corypeters.net- Proposed As Answer byCory Peters Tuesday, August 04, 2009 3:56 PM
- Marked As Answer byLionel Chen - MSFTMSFT, ModeratorFriday, August 14, 2009 4:18 AM
- Thank you Cory - I will give it a try!
- I tried to do this, but it would seem that I need access to the "back-end" of the server to do it. Is this correct. I've written the code in Visual Studio and added the Reference Microsoft.SharePoint.dll but I get an error which can be summarised as File Not Found (Pointing to the DLL).
- You need to run the code from a server in the farm.
SharePoint Developer | Administrator | Evangelist -- Twitter -- Blog - http://nextconnect.blogspot.com- Marked As Answer byLionel Chen - MSFTMSFT, ModeratorFriday, August 14, 2009 4:18 AM
- You can also use PowerShell to enable content type management in wiki libraries:
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") $sitecollection = "SITECOLLECTION_URL" $subsite = "SUBSITE_URL" $site = new-object Microsoft.SharePoint.SPSite($sitecollection) $web = $site.OpenWeb($subsite) $list = $web.Lists["WIKILIBRARY_NAME"] $list.ContentTypesEnabled = $true $list.Update() $web.Dispose() $site.Dispose()
Useful as it seems that site columns are only added at list level but not to the content type "Wiki Page"!- Proposed As Answer bydatoli Wednesday, October 28, 2009 8:42 AM

