Customising Wiki Pages - Part 3
Let's start getting our hands dirty
Now that we have establish that the content are stored in the fields, let's look at what wkpstd.aspx, and start customising.
When you put the standard wiki page into edit mode, you will see that there is only a single webpartzone at the bottom of the page. At the end of Part 3, we will be adding a new webpartzone on the right hand side of the page.
From the windows explorer, navigate to "program files\common files\microsoft shared\web server extension\12\template\documenttemplates" and open up wkpstd.aspx with your favourite html editor. For me, it is visual studio. At line 31, you will see "asp:content contentplaceholderid=PlaceHolderMain". In this place holder, "SharePoint:FormField FieldName=WikiField" display the content of the wiki page.
The next control, "SharePoint:ListFieldIterator" displays the rest of the fields that are in the list. Meaning, if you add a new field, say "Featured" of type boolean, you will see a checkbox with the text "Featured" after the wiki content. But if you put the Featured field into the ExcludeFields attribute, the checkbox won't appear. Cool? I think it is...
Now that we understand the basic components that page up wkpstd.aspx, let's add in the right webpartzone. We do that by adding a table to have two column layout, and add the zone on the right column. Codes in blue are new codes
<table cellpadding="0" cellspacing="0" border="0" Width="100%" class="ms-descriptiontext">
<tr valign="top">
<td>
<SharePoint:FormField FieldName="WikiField" ControlMode="Display" runat="server" />
<table cellpadding="0" cellpadding="0" border="0">
<tr>
<td>
<table class="ms-formtable" border="0" cellpadding="0" id="formTbl" cellspacing="0" width="100%">
<SharePoint:ListFieldIterator ControlMode="Display" TemplateName="WideFieldListIterator"
ExcludeFields="FileLeafRef;#WikiField;#Featured;#Category" runat="server" />
</table>
</td>
</tr>
</table>
</td>
<td>
<WebPartPages:WebPartZone runat="server" FrameType="None" ID="Right" Title="loc:Right"></WebPartPages:WebPartZone>
</td>
</tr>
</table>
Save the page, and create a new wiki page. Next place the new page in edit mode, and you will soon see the new webpartzone on the right. Existing pages have the new webpartzone too. But do note that the changes effect every wiki page on the server. Enjoy1