How to create a minimal master page

To create a minimal master page

  1. Open SharePoint Designer.

  2. On the File menu, click New, point to SharePoint Content, and then click the Page tab.

  3. Double-click Master Page to create a new master page.

  4. Click Design to show the master page in design view. You should see header and left margin areas and several content placeholders in the master page.

  5. Click Code to show the master page in code view.

  6. Copy the following code into the master page.

    Xml
    <%-- Identifies this page as a .master page written in Microsoft Visual C# and registers tag prefixes, namespaces, assemblies, and controls. --%>
    <%@ 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="SPSWC" Namespace="Microsoft.SharePoint.Portal.WebControls" Assembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" 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="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, 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" %>
    <%@ Register TagPrefix="PublishingVariations" TagName="VariationsLabelMenu" src="~/_controltemplates/VariationsLabelMenu.ascx" %>
    <%@ Register Tagprefix="PublishingConsole" TagName="Console" src="~/_controltemplates/PublishingConsole.ascx" %>
    <%@ Register TagPrefix="PublishingSiteAction" TagName="SiteActionMenu" src="~/_controltemplates/PublishingActionMenu.ascx" %>
    <%-- Uses the Microsoft Office namespace and schema. --%>
    <html>
      <WebPartPages:SPWebPartManager runat="server"/>
      <SharePoint:RobotsMetaTag runat="server"/>
    
      <%-- The head section includes a content placeholder for the page title and links to CSS and ECMAScript (JScript, JavaScript) files that run on the server. --%>
      <head runat="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>
      
      <%-- When loading the body of the .master page, SharePoint Server 2007 also loads the SpBodyOnLoadWrapper class. This class handles .js calls for the master page. --%>
      <body οnlοad="javascript:_spBodyOnLoadWrapper();">
        <%-- The SPWebPartManager manages all of the Web part controls, functionality, and events that occur on a Web page. --%>
        <form runat="server" οnsubmit="return _spFormOnSubmitWrapper();">
          <wssuc:Welcome id="explitLogout" runat="server"/>
          <PublishingSiteAction:SiteActionMenu runat="server"/>  
          <PublishingWebControls:AuthoringContainer id="authoringcontrols" runat="server">
            <PublishingConsole:Console runat="server" />
          </PublishingWebControls:AuthoringContainer>
          <%-- The PlaceHolderMain content placeholder defines where to place the page content for all the content from the page layout. The page layout can overwrite any content placeholder from the master page. Example: The PlaceHolderLeftNavBar can overwrite the left navigation bar. --%>
          <asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" />
            <asp:Panel visible="false" runat="server">
            <%-- These ContentPlaceHolders ensure all default SharePoint Server pages render with this master page. If the system master page is set to any default master page, the only content placeholders required are those that are overridden by your page layouts. --%>
    <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:ContentPlaceHolder id="PlaceHolderBodyRightMargin" runat="server" />
    </asp:Panel>
        </form>
      </body>
    </html>
    
  7. On the File menu, click Save As, provide a unique file name with the .master extension, and then save the file to the master page gallery (/_catalogs/masterpage) in your site collection.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 该服务是通过最小配置创建的服务。它指的是通过设置最基本的参数和选项来创建该服务。它可能是一种简化版本,仅包含最基本的功能和设置,以便用户可以快速使用。这种最小配置的服务通常适用于那些对服务需求简单的用户,或者用于测试和演示目的。它可以提供基本的功能,并且易于部署和使用。使用最小配置创建的服务也可以是一个基础架构,可以根据用户的需求和要求进行扩展和定制。这种服务的好处是它的简洁性和易用性,用户不需要额外的配置或复杂的设置就可以开始使用。然而,由于它只包含最少的功能和选项,有些高级用户可能会觉得它的功能有限。总之,这种最小配置的服务通过提供一种简单、易用的解决方案,能够满足那些对功能要求不高或者只需要满足基本需求的用户。 ### 回答2: 这项服务是基于最简化配置创建的服务。 这项服务是根据最基本的设置创建的,以提供用户所需的功能和服务。它的设计宗旨是简洁高效,仅包含必要的组件和功能。通过剥离多余的功能和复杂的配置选项,该服务能够更加轻便和易于使用。 最小配置的概念意味着该服务只关注核心功能,避免了系统的过度复杂性。它专注于基本功能的实现,并将其他高级和可选功能保留为可扩展的插件或模块。因此,用户可以根据需要选择性地添加或配置这些额外的功能,以满足其特定的需求。 由于采用了最小配置的方法,该服务不仅更易于安装和使用,而且具有更高的性能和可靠性。用户不需要投入大量的时间和精力来研究复杂的配置选项,降低了学习曲线和使用门槛。 尽管该服务是基于最小配置的设计,但仍提供了足够的灵活性和可定制性。用户可以根据自己的需求和偏好调整和配置服务,以使其完全符合其特定的要求。 总而言之,基于最小配置的服务提供了一个简洁而可靠的选择,适合那些希望专注于核心功能,并希望快速启动和使用的用户。 ### 回答3: 该服务是从最简配置中创建的服务。 这句话表明该服务是基于最小配置开发的,意味着它只包含必要的功能和设置,以确保其高效性和稳定性。 最小配置意味着减少了冗余功能,只保留了核心组件和设置。这使服务更易于部署和维护,并提高了性能和可靠性。通过精简配置,该服务可以快速启动,并占用较少的资源。 最小配置的设计哲学是根据实际需求确定必要的功能和设置,避免过度设计和不必要的复杂性。这样可以提高开发和运维效率,并减少潜在的故障点。 尽管该服务是从最小配置创建的,但它并不意味着缺乏功能或灵活性。最小配置的设计原则是在不浪费资源的同时提供所需的功能。因此,该服务仍然可以满足用户的需求,并且可以根据需要进行扩展和定制。 总之,该服务是以最简配置为基础创建的,旨在提供高效、稳定和可靠的功能。通过精简的配置,该服务能够在不浪费资源的情况下满足用户需求,并保持灵活和可扩展性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值