I have a team site and where I need to create a custom page template (possibly wiki) which user can use for creating wiki pages.

This page layout should have quick launch and blank web part zone.That is not a problem because I have done it for publishing site and I get the page layout associated with my own custom content type.

However the problem is I am not finding any reference which shows how this can be accomplished in team site/non publishing site.

Note : I cannot activate publishing feature as it has to be strictly team site.

I will be very glad if anyone please give some pointer/assistance on this.


After much research I have found below details with which we can create a custom wiki page template.

If we dive into the Wiki content type (I used sharepoint inspector to easily see the properties), you will see that when you create a new page, the "CreateWebPage.aspx" page is called on the layouts directory.

So whenever you create a new item (wiki page) in the wiki page library it will navigate you to the “Createwebpage.aspx” where you can fill the wiki field and create the wiki page.

<DocumentTemplate TargetName="/_layouts/CreateWebPage.aspx" />

This page makes sure the wiki page is created and a template file is connected to it called "wkpstd.aspx" in the DocumentTemplates directory (C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\DocumentTemplates). This page takes are of the layout of the wiki page.

So changing this is not recommended so I left it and decided to create a copy of it i.e. wkpstd_custom.aspx.

In the onet.xml we’ve changed the wkpstd.aspx to our custom page.

<Module Name="DefaultWikiPages" List="1119″ Url="$Resources:core,WikiWebLibPages_Folder;" Path="" SetupPath="DocumentTemplates">
     <File Url="wkpstd_custom.aspx" Name="$Resources:core,nav_Home;.aspx" Type="GhostableInLibrary">
       <Property Name="WikiField" Value="$Resources:core,WikiHomeContent;" />
       <NavBarPage Name="$Resources:core,nav_Home;" ID="1002″ Position="Start" />
       <NavBarPage Name="$Resources:core,nav_Home;" ID="1010″ Position="Start" />
     <File Url="wkpstd_custom.aspx" Name="$Resources:core,nav_HowToUseThisWikiSite;.aspx" Type="GhostableInLibrary">
       <Property Name="WikiField" Value="$Resources:core,WikiHowToUseContent_Part1;$Resources:core,WikiHowToUseContent_Part2;$Resources:core,
WikiHowToUseContent_Part6;$Resources:core,WikiHowToUseContent_Part7;$Resources:core,WikiHowToUseContent_Part8;" />
       <NavBarPage Name="$Resources:core,nav_HowToUseThisWikiSite;" ID="1010″ />

Now Create a new copy of CreateWebPage.aspx file with your own custom code.

This page will create new pages based on the new custom aspx file as a template

Create an eventhandler that will activate with the site definition that programatically sets the template page for each new created wiki page.

You can use the code sample given below in the code behind of button click Event in your custom "CreateWebPage.aspx"

  SPWeb oWeb = SPContext.Current.Web;
  SPList oList = oWeb.Lists["Wiki Pages"];
  SPFileCollection oFiles = oList.RootFolder.Files;
  SPFile oFile = oFiles[0];//getting the home page to collect the byte array of the custom document template
  byte[] oByte = oFile.OpenBinary();
  SPFile oFile1 = oFiles.Add(oList.RootFolder + "/TestWiki.aspx", oByte);
  SPListItem oItem = oFile1.Item;
  oItem["Name"] = "Test";
  oItem["WikiField"] = Name.Text;// (Name is the ID of the textbox. Get the wiki content from the Rich textbox of the CreateWebPage.aspx

That's all.

Reference from here http://blogs.msdn.com/b/pavankumar/archive/2009/02/25/custom-wiki-site-definition-with-custom-document-template-for-creating-wiki-pages.aspx

| improve this answer | |

Try this:

  1. Go into Site Settings. Under Site Collection Administration, select SharePoint Desginer Settings.

  2. Make sure "Enable Customizing Master Pages and Page Layouts" is selected.

  3. Then open SharePoint Designer and select All Files on the left menu.

  4. Choose "_catalogs" and then "masterpage." Copy one of the master page's HTML and Master page file (for example, seattle.html and seattle.master) and paste them. Rename them to something else.

Now you have a separate master page that you can customize and apply to your Team Site. Note that you will not be able to apply it in the SharePoint UI, but you can right-click the master page in SharePoint Designer and set it as the default page.

This was also discussed in a previous post in this forum. Please see: How to apply custom site layout on my Team Site?.

Hope this helps!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy