Enterprise Wiki site template vs. Wiki Library template
Posted
Sunday, April 15, 2012 8:00 PM
by
Itay Shakury
We all know wikis and how they work. It's a quick way to create inter-connected items of unstructured data.
SharePoint 2010 Introduces two wiki solutions that appear similar on first sight, but are actually different. In this post I will cover technical differences between the two.
First is the "Enterprise Wiki" site template. It's a template that can be used to create site collections, or sub-sites. The Enterprise Wiki site template creates a site that is dedicated to wiki content. The main component in the site is the "Pages" Library. We will explorer it later.
Second is the "Wiki Page Library" list template. This Wiki Library can host wiki pages. It can be created in any kind of site.
As a matter of fact, this Wiki Library list template is used as the default pages library in the "Team Site" site template.
According to this article on MSDN, here is a short comparison between the two:
| If you want to: | Use this site template: |
| Encourage one-to-many communication | Team Site |
| Encourage many-to-many communication | Enterprise Wiki |
| Offer a structured exchange of information | Team Site |
| Enable a collaborative exchange of information | Enterprise Wiki |
| Insert images or files in a pages | Team Site or Enterprise Wiki |
| Mark pages for easier reference by tagging them with enterprise keywords | Enterprise Wiki |
These are nice guidelines, but what is the real difference of each?
I am now going to go through the detailed process that I took for investigating the case. You can skip to the end if you want the summary.
Wiki Page Library
The template is part of the feature called "WebPageLibrary". In this feature, you can find the list definition at: "14\TEMPLATES\FEATURES\WebPageLibrary\ListTemlpates\WebPageLibrary.xml".
If you look at it, you'll notice that the list template id is 119, and BaseType="1", which means it is a regular document library.
If we take a look at the schema.xml file at "14\TEMPLATES\FEATURES\WebPageLibrary\WebPageLib\schema.xml", we will see that the template associates a content type with ID 0x010108 to the library. This content type is called "WikiDocument", and is defined in: "14\TEMPLATES\FEATURES\ctypes\ctypeswss.xml". It inherits from the base "Document" content type, does 2 things: Add the "WikiField", and remove the "Title" field.
The "WikiField" field is what holds the content of the page.
Enterpries Wiki
This is an entierly different beast. First of all, it's a site definition. You will find the "Enterprise Wiki" site definition at 14\TEMPLATE\1033\XML\webtempsps.xml. Let's take a closer look at it.
The site definition onet.xml file is at: 14\TEMPLATE\SiteTemplates\ENTERWIKI\XML\onet.xml. In here, we can see that this is actually a publishing site (publishing features, such as "Publishing 22A9EF51-737B-4ff2-9346-694633FE4416" are activated).
In addition to the standatd pablishing features, there's an additional feature with id "76D688AD-C16E-4cec-9B71-7B7F0D79B9CD". This is the EnterpriseWiki feature, you can find it's source at: 14\TEMPALTE\FEATURES\EnterpriseWiki.
If you take a look at EnterpriseWikiContentTypeBinding.xml, you will see that the feature takes the default pages library that is created with the publishing infrastructure, and binds to it 2 content types. One is the standard Redirect Page content type, and the other is the Enterprise Wiki content type.
The Enterprise Wiki content type is defined at: 14\TEMPALTE\FEATURES\EnterpriseWikiContentTypes, and defines the following fields: ModifiedBy, PublishingPageContent, Rating, RatingCount.
If we take a look at the page layout at: 14\TEMPALTE\FEATURES\EnterpriseWikiLayouts\PageLayouts\EnterpriseWiki.aspx, we will see that the field that holds the content of the page is "PublishingPageContent". This field is just like the "WikiField" field that we discussed earlier.
Rendering
Handling wiki style markup is integrated into SharePoint foundation. From what I have found, it seems that the translation from wiki syntax to html is done in the field level (not UI control). The class "SPFieldMultilineText" has a property called "WikiLinking" (boolean), that toggles the feature on or off.
For publishing pages, the "HtmlField" inherits indirectly from SPFieldMultilineText, so it supports this too.
You can use this feature with regular publishing pages as well (not nessicarely wiki page layouts).
If you look at the source of a publishing page you will see a line similar to this: document.getElementById('ctl00_PlaceHolderMain_PageContent_RichHtmlField_displayContent').WikiLinking = 'on';
This controls whether or not the wiki syntax translation is active.
Summary
SharePoint has different 2 solutions for wiki style editing:
1. Wiki Library - a web pages library that uses the "Wiki Document" content type. This content type has a field called "WikiField" to hold the wiki content.
2. Enterprise Wiki - a site definition that is based on the publishing infrustructure. As such, it is based on the built in "Pages" library. It uses a content type called "Enterprise Wiki", in which the field "PublishingPageContent" is used to hold wiki content.
This knowledge can be helpful if you are developing solutions that are usign the wiki features programmatically.
-- My name is Itay Shakury, and I'm a SharePoint consultant --