February 14, 2008

Customizing SharePoint Wiki Pages

We were looking at adding additional functionality to the SharePoint Wiki Pages. Our client wanted to classify his Wiki Pages into either of two categories. The home page of the wiki site would lead to a page listing all the wiki pages as hyper links.

The page would look (functionally speaking) something like this.

CATERGORY ONE

CATEGORY TWO

Page 1

Page 2

Page 5

Page 3

Page 6

Page 4

Page 7

Page 9

Page 8

Page 10


Initially they maintained the page by adding the hyper links manually and sorting the pages between the two categories they defined. After using it for a while, they now want this to be an automatic feature. The system should be able to recognize which category a wiki page belongs to and list it under that category on the home page.

Wiki Pages are implemented like SharePoint lists.

  1. Therefore the first thing we did was to add an extra column to the Wiki Pages document library. We added a category look up column and added the two categories mentioned by our client.
  2. Then edited all the exiting wiki pages in the AllItems view to associate the appropriate category.
  3. Then dropped in two list views side by side in a webpart zone and filter them based on the category.

Problem 1: When viewing the Wiki Pages, the category column and its content are displayed below the wiki content which I don't want. The column should appear when editing or creating the wiki page but not when viewing it.

Solution:
Open WKPSTD.ASPX located in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\DocumentTemplates\
Look for SharePoint:ListFieldIterator and add the fields you don't want to show up to the ExcludeFields property.

Example:
<SharePoint:ListFieldIterator
ControlMode="Display"
TemplateName="WideFieldListIterator"
ExcludeFields="FileLeafRef;#WikiField;#Field1;#Field2; " runat="server"/>

Problem:
I don't want certain wiki pages to be edited. Like the home page of the site that leads to the list views.
Solution:
Open the page using SharePoint Designer and look for <SharePoint:FormComponent TemplateName="WikiMiniConsole" ControlMode="Display" runat="server"/>.
This has a visible attribute that you can set to false.
<SharePoint:FormComponent TemplateName="WikiMiniConsole" Visible="False" ControlMode="Display" runat="server"/>.

1 comment:

Anonymous said...

Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Toner, I hope you enjoy. The address is http://toner-brasil.blogspot.com. A hug.