Thursday, September 4, 2008

Adding a New Wiki Page link in MOSS 2007

I recently got a request to add a link for new wiki page creation to wiki pages in Microsoft Office SharePoint Server 2007 (MOSS 2007).

If you go to a wiki page in MOSS you will see something like this:

My customer wanted to have another link in the top right corner of wiki pages and to be able to create new wiki pages without going to the wiki pages library (if you go to the wiki pages library directly then you will have an option to add a new wiki page).

In order to make the requested change I followed the next steps:

  • went to the "\12\TEMPLATE\CONTROLTEMPLATES\" folder on MOSS machine

  • opened "DefaultTemplates.ascx" file with a text viewer

  • found template whose ID is "WikiMiniConsole"

  • selected and copied the whole content of the template

  • created a new text file called "WikiMiniConsole.ascx" and opened the file with VisualStudio (I could use any text editor)

  • pasted the copied text (the WikiMiniConsole template) into the new ASCX file

  • added a few lines of code to the top of the file to declare it as ASP.NET control and to register necessary tag prefixes (I copied the lines from "DefaultTemplates.ascx")

  • located the Template_Buttons section and added a link button to that section:
    <asp:hyperlink id="lnkNewWikiPage" runat="server" text="New Wiki Page" navigateurl="/_layouts/CreateWebPage.aspx?List=%7B0A589486%2D5E83%2D4DBF%2D9607%2DFA218150B179%7D&amp;RootFolderUrl=%2FWikiPagesLibrary" cssclass="ms-toolbar"></asp:hyperlink>

  • saved the new ASCX file and deployed it to "\12\TEMPLATE\CONTROLTEMPLATES\" folder on MOSS machine

After that I had to recycle worker threads for MOSS site and finally I got the new link in wiki mini console:

You can download the WikiMiniConsole.ascx that I made from here.


Unknown said...

how do i recycle worker threads for MOSS site?

Popovic Sasa said...

Hello kisin,

You should follow the next steps:
1. Open IIS Management Console
2. Go to "Web Sites" node, expand it and find the website hosting your MOSS
3. Check which application pool it is using
4. Go to "Application Pools" node, expand it and locate the application pool used by your MOSS website
5. Right click on located applicatino pool and choose "Recycle" option


Unknown said...

Hey Popovic Sasa,

Can you please reupload the WikiMiniConsole.ascx file or send me a copy?

Popovic Sasa said...

@bear, I uploaded it again. Sorry about that.