“How can I add a template to a SharePoint wiki?”… you can’t!… or can you? I’m so confused.
Is there a simple way to alter all wiki content pages so that I can have a consistent look and feel throughout an entire SharePoint wiki library?
I’ve been struggling with this one for a couple of days. The basic layout of a SharePoint wiki is really bad. It spans the entire page width with a font so tiny you need a magnifying glass to read it.
I’ve developed an HTML template that I’ve been using to create a better format for the page, but I’m tired of having to open the source editor on EVERY SINGLE WIKI PAGE and embedding the template before entering content. What does the HTML template do?
- Limits the width of the content to 650 pixels
- Makes the text a readable size
- Displays a consistent wiki menu at the bottom of each page in a horizontal format.
Sounds pretty good, right? So why don’t I just embed it in the wiki template and be done with it? Well to start, there’s no such thing as a wiki template! No wonder I couldn’t find the thing. I went to my regular resources, Paul Galvin, Paul Grenier and Bob Mixon. Here’s what I got back from Paul Grenier of Stump the Panel fame:
CreateWebPage.aspx (or something like that) is building the page. The problem is that I think it’s getting some context from the library and setting those pages up based on some deep config (SCHEMA, ONET, etc.). I feel your pain, but it’s one of the reasons I tell people not to expect a whole lot from MOSS wikis OOB.
Not what I was hoping to hear. The CreateWebPage.aspx page is not a template that’s driving the format. It’s the one that’s actually creating the form that’s being filled out to create the wiki page.
Then I got a response from Bob. This guy will definitely know how to do it:
A Wiki is a Site, based on a Site Definition that is managed in the 12-hive on the Web Front End Server (WFE). It is not something you can just go and make those types of changes to. Wiki pages are stored in a Document Library (named Wiki Pages) on the Wiki Site itself; similar (but not the same) as a Publishing Site or Blog.
If your goal is to change the solution so a common footer is displayed regardless of the page, then I would recommend masterpage/style changes.
The Content Type and Wiki Pages Document Library associated with a Wiki are fairly locked down. From the browser, you can’t even go and add a new Content Type to the library.
What? “12-hive on the Web Front End Server (WFE)….” Am I on a different planet? What the hell is that?
There is no template for the wiki? I have to change the site’s master page, you mean the one that runs the ENTIRE SITE? Uhhhhhh, nope, sorry Bob, the judges don’t accept that one. But when I find out where the hive is, I’ll send you some honey.
Here’s Paul’s response after reading Bob’s reply:
At least I wasn’t missing something. I came to the same conclusion. So I guess, the best way to handle non-content related changes is what Bob said, edit the master. But if you have a site collection with mixed purpose, you could either try to edit the feature/solution to make sure your customizations don’t end up on non-wiki pages or parse the word “wiki” from the URL to decide whether or not to show that master content.
Content relevant information (like a data view web part with wiki stats) will need to be loaded into the page’s available zone. Is there a way to deploy web parts to that zone for every page in the library? That seems like a straight forward request. (IF Zone 1 has WP end; ELSE add WP). Just make it itinerate over the library or with a workflow on new/edit.
This is getting worse and worse. Is there a simple way to alter all wiki content pages so that I can have a consistent look and feel throughout the entire wiki? Nope, can’t use community kit, it’s not out of the box. Nope, no hacking server files for obvious reasons. Nope no coding solutions, again, pretty obviously not out of the box.
Paul Galvin sent me an email pointing to a small write up by Jeremy Thake that started to lead down a rabbit hole. At the bottom was a rabbit called the “wkpstd.aspx” page. Now we’re started to get somewhere!
Everywhere I googled, wkpstd.aspx seemed to be the place to make changes. The problem is, half of the discussion was about problems incurred while trying to make changes to the file. The big problem is, this changes the template at the SERVER level, not the site level. A typical site admin can’t change the file, and even if they could, it would change every wiki page on the server. Yikes!
So here’s the challenge. Who’s found a way to alter the HTML output of the wiki page at the site or site collection level? We’re looking for real world feedback here. The first usable solution wins the door prize.
(And before I get hammered with comments, yes, I know what 12 hive is, but most of our audience doesn’t and I was speaking for them… calm down. Everyone’s going to make it through this as a team, right?)
No wiki pages were harmed during the creation of this article. Here are some resources for you to do a little investigation.
- How SharePoint Wikis Work
- Customising Wiki Pages – Part 1 through 3
- Exploring the 12 Hive: Template Directory
- Customize the SharePoint Wiki Page
What’s the prize?
Like?
0
0
Hi Mark,
Though I haven’t had a chance to work on it yet, here is the idea I wanted to try out: if you cannot embed any modifications in a wiki page, do the opposite – embed the wiki in a page that you can modify.
So the steps would be:
1/ Create a Web Part page
2/ Add a Page Viewer Web Part that points to the wiki
3/ Add a Content Editor Web Part with the styles and scripts that apply to your wiki page (here you need to remember that the wiki is actually in an iframe within your page)
4/ Add anything else you want to the page (document library for attachments, etc.)
Christophe
Like?
0
0
Loke – In your case, how about a nice weekend in Singapore? Great shots of the city, by the way. How did you get those views? I spent a week there earlier this year and love the place.
Like?
0
0
Christophe,
Interesting solution, but I don’t see how I will be able force wrapping and font size in the iFrame. Since the page would be nothing more than a wrapper, I won’t be able to control the format of the content in the iFrame.
Mark
Like?
0
0
Mark,
The iframe is just another HTML element in the page, so you should be able to reach it the same way you do with other elements. If you have an example of style change that you applied on your wiki, I can do a quick test.
Christophe
Like?
0
0
I took that @ Microsoft’s Office.
I’m going to give you a hint…
Wiki Page is still a webpart page, and that web part page is what you already found out, wkpstd.aspx. From the html source, you will see that there is a webpart zone at the bottom of the screen. Let see if you can continue from here.
Like?
0
0
Are you fimiliar with the Enhanced Wiki Edition 2.0 Beta 2 CKS on codeplex. It does actually not solve all your issues, but it is an interesting project.
http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=CKS&ReleaseId=8087
Like?
0
0
I spent a long time on this one… mostly because I’m not much of a developer, but what I found was wkpstd.aspx is copied to the Wiki document library for each new page you make. Through some digging (brute force, I grep’d the sharepoint bin folder) it looks like an event handler does this, as wkpstd.aspx was found in one of the SharePoint DLLs.
Rather silly to code in a template name like that, ey?
I found one solution but never got it to work (again, mostly because I’m not a developer) but it had to do with overriding the save event on the create page form and using your own event handler to copy a template of your choosing.
Like?
0
0
I’m Kevin, responsible for wikis in SharePoint vNext. I’m on twitter: @spwiki, I’d encourage you and others interested in SharePoint wikis to follow me there.
We’ve certainly heard the request for wiki templates, we certainly don’t have a good solution in v3. Great write-up of your attempt to make this work :)
Like?
0
0
Hi!
Our solution is this (we have rights to change iis settings):
Copy from 12\TEMPLATE these folders to somewhere else, like: c:\my_site_custom_templates.
CONTROLTEMPLATES
IMAGES
LAYOUTS
In IIS at your site settings change the virtual folders to access your copied folders:
_controltemplates – CONTROLTEMPLATES
_layouts – LAYOUTS
_layouts/images – IMAGES
Restart IIS.
Drawback is that if you do a backup/restore, you have to manually set these things, and web part install and sharepoint updates will not work correctly; you have to copy the files and changes. But I will be a happy man if this was the only problem with sharepoint.
Like?
0
0
And another drawback is that you can’t change wkpstd.aspx
Because this single file is in another folder. Pfh.
Like?
0
0
I’m working on a site definition for a SharePoint wiki for my current project. It’s working pretty well so far, I’ve managed to make my custom stylesheet and masterpage stick to any newly created pages by including my own version of wkpstd.aspx in the site definition itself.
Send me a mail if you’re interested in the raw XML, it might be helpful :)
But if I can just leave a question of my own here: Does anybody know how to extend the underlying wiki content type? My users want to be able to add attachments to a wiki article and I can’t figure out where the wiki content type comes from?
Like?
0
0
Hi Loek,
Can you please share your approach on having your own version of wkpstd.aspx in a custom site definition?I am working on a similar requirement :)
Like?
0
0
Hi Loek,
It would be great if you could help me with customizing the wkpstd.aspx. Could you give some tips?
Like?
0
0
Hi Loek,
I am interested in your solution for creating consistent looking wiki pages. I am working in WSS 3.0 and want to make each page in the wiki library look the same. I don’t want to not show the mini console (links to Edit, History, Incoming Links), but rather just create my own Edit link to be able to edit the wiki page. Does this make sense and does your solution work on just wiki libraries and not a wiki site? Can you offer suggestion on how to create a hyperlink to edit the page. Thank you.
Like?
0
0
Jan – Start here:
http://www.bitsofsharepoint.com/BlogPoint/Lists/Posts/Post.aspx?ID=39
Mark
Like?
0
0