Partager via


Minimal SharePoint Master Page

I often get asked about how to go about customising a WSS/MOSS master page.

Here is the advice I give:

  1. Don't for the love of the children try to write one from scratch! You will end up pulling out your hair and banging your head against a brick wall. Start with one of the out of the box ones, and remove/change the bits you want.
  2. Start with the Minimal.master page up on MSDN. This is a very basic bare bones master page. It has everything you need in a masterpage, but no look and feel. You can then go and add everything you need.

Get it here:

How to: Create a Minimal Master Page: https://msdn2.microsoft.com/en-us/library/aa660698.aspx

Comments

  • Anonymous
    January 31, 2007
    Hey Chris,  The minimal Master page code fails when using it as a default.master page for standard WSS.  We don't use MOSS.  Is this code surposed to work or is there some things that have to be removed?  THe site error states that a file cannot be found.  I suspect the code references extra stuff in there that is only for MOSS.    Any ideas on what stuff should be taken out.

  • Anonymous
    January 31, 2007
    <%@ Master language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %> <%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %> <html dir="<%$Resources:wss,multipages_direction_dir_value%>" runat="server" xmlns:o="urn:schemas-microsoft-com:office:office" __expr-val-dir="ltr"> <head runat="server"> <WebPartPages:SPWebPartManager runat="server" /> <SharePoint:RobotsMetaTag runat="server" /><%-- The head section includes a content placeholder for the page title and links to CSS and JavaScript files that run on the server. --%> <asp:ContentPlaceHolder runat="server" id="head">  <title>   <asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server" />  </title> </asp:ContentPlaceHolder> <Sharepoint:CssLink runat="server" /> <asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server" /> </head> <body> <form runat="server" onsubmit="return _spFormOnSubmitWrapper();"> <wssuc:Welcome id="explitLogout" runat="server" /> <SharePoint:SiteActions runat="server" AccessKey="<%$Resources:wss,tb_SiteActions_AK%>" id="SiteActionsMenuMain" PrefixHtml="&lt;div&gt;&lt;div&gt;" SuffixHtml="&lt;/div&gt;&lt;/div&gt;" MenuNotVisibleHtml="&amp;nbsp;">              <CustomTemplate>              <SharePoint:featuremenutemplate runat="server"               FeatureScope="Site"               Location="Microsoft.SharePoint.StandardMenu"               GroupId="SiteActions"               UseShortId="true"               >               <SharePoint:menuitemtemplate runat="server" id="MenuItem_Create"                Text="<%$Resources:wss,viewlsts_pagetitle_create%>"                Description="<%$Resources:wss,siteactions_createdescription%>"                ImageUrl="/_layouts/images/Actionscreate.gif"                MenuGroupId="100"                Sequence="100"                UseShortId="true"                ClientOnClickNavigateUrl="~site/_layouts/create.aspx"                PermissionsString="ManageLists, ManageSubwebs"                PermissionMode="Any" />               <SharePoint:menuitemtemplate runat="server" id="MenuItem_EditPage"                Text="<%$Resources:wss,siteactions_editpage%>"                Description="<%$Resources:wss,siteactions_editpagedescription%>"                ImageUrl="/_layouts/images/ActionsEditPage.gif"                MenuGroupId="100"                Sequence="200"                ClientOnClickNavigateUrl="javascript:MSOLayout_ChangeLayoutMode(false);"                />               <SharePoint:menuitemtemplate runat="server" id="MenuItem_Settings"                Text="<%$Resources:wss,settings_pagetitle%>"                Description="<%$Resources:wss,siteactions_sitesettingsdescription%>"                ImageUrl="/_layouts/images/ActionsSettings.gif"                MenuGroupId="100"                Sequence="300"                UseShortId="true"                ClientOnClickNavigateUrl="~site/_layouts/settings.aspx"                PermissionsString="EnumeratePermissions,ManageWeb,ManageSubwebs,AddAndCustomizePages,ApplyThemeAndBorder,ManageAlerts,ManageLists,ViewUsageData"                PermissionMode="Any" />              </SharePoint:featuremenutemplate>              </CustomTemplate>             </SharePoint:SiteActions> <asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" />  <asp:Panel visible="false" runat="server">   <asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server"/>   <asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server"/>   <asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea"  runat="server"/>   <asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server"/>   <asp:ContentPlaceHolder ID="PlaceHolderPageImage" runat="server"/>   <asp:ContentPlaceHolder ID="PlaceHolderBodyLeftBorder" runat="server"/>   <asp:ContentPlaceHolder ID="PlaceHolderNavSpacer" runat="server"/>   <asp:ContentPlaceHolder ID="PlaceHolderTitleLeftBorder" runat="server"/>   <asp:ContentPlaceHolder ID="PlaceHolderTitleAreaSeparator" runat="server"/>   <asp:ContentPlaceHolder ID="PlaceHolderMiniConsole" runat="server"/>   <asp:ContentPlaceHolder id="PlaceHolderCalendarNavigator" runat ="server" />   <asp:ContentPlaceHolder id="PlaceHolderLeftActions" runat ="server"/>   <asp:ContentPlaceHolder id="PlaceHolderPageDescription" runat ="server"/>   <asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat ="server"/>   <asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat ="server"/>  </asp:Panel> </form> </body> </html>

  • Anonymous
    July 26, 2007
    So I was asked by a partner of mine to help them create a minimal.master page for WSS. No problems, I've

  • Anonymous
    July 26, 2007
    So I was asked by a partner of mine to help them create a minimal.master page for WSS. No problems, I&#39;ve

  • Anonymous
    July 30, 2007
    PingBack from http://mhinze.com/9-links-today-2007-07-30/

  • Anonymous
    October 23, 2007
    I want to add a menu item in sharepoint 2007. If you open the sharepoint home page you can see the webparts available there. If you click document library link it will take you to the respective page. There you can see list of documents under related documents. If you click any document it will show a combobox with options as view properties, edit properties, manage permissions, edit in Microsoft office word, delete, sent to option as other location, e-mail a link, create document workspace, and download a copy. Here in this send to menu I want to add another item called Fax. I want to do this in C# 2.0. Should I create web application or website for this? How to do this? Please help me.

  • Anonymous
    June 08, 2009
    PingBack from http://hairgrowthproducts.info/story.php?id=45