Wednesday, May 11, 2011

New SharePoint Wiki Page Default Content

When you create a new SharePoint 2010 Enterprise Wiki site you will see default content on the home page.  However, new wiki pages are created without any content.

What if you wanted to have some default content that defined a template for your Wiki pages?  This would just be content that could be modified by users, but could at least provide a template for your users to build on.

Well there is not a simple way to configure this, but you can accomplish it with a custom page layout that you can associate with your Enterprise Wiki, and even set as the default page layout for new pages.

First, create a custom page layout for the Enterprise Wiki, following the instructions here: http://blog.henryong.com/2010/06/08/how-to-create-custom-sharepoint-2010-page-layouts-using-sharepoint-designer-2010/


After this, you should have a custom page layout based on the default page layout for the Enterprise Wiki.  You can edit the PublishingWebControls:RichHtmlField tag, adding an "html" attribute, and setting the value to the HTML content that you would like to have displayed on all new pages.

So, the tag would look something like this:

<PublishingWebControls:RichHtmlField  id="PageContent" FieldName="PublishingPageContent" Html="{default html content here}" DisableInputFieldLabel="true" runat="server"/>

Set your new page layout as the default page layout for new Wiki pages and you're new pages will have this default content for all new pages.

1 comment:

  1. Good, just need to ensure that single quotes are used within double quotation.
    Ref: http://social.technet.microsoft.com/Forums/lv/sharepoint2010customization/thread/442de150-3261-4633-929c-5d7ba631c986

    ReplyDelete