MOSS开发MasterPage

MOSS开发MasterPage

 

註意看里面的說明


<%@Master language="C#"%>
<%@ 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" %> <%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ 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">
    
<META Name="GENERATOR" Content="Microsoft SharePoint">
    
<META Name="progid" Content="SharePoint.WebPartPage.Document">
    
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
    
<META HTTP-EQUIV="Expires" content="0">
    
<SharePoint:RobotsMetaTag runat="server"/>
    
<Title ID=onetidTitle><asp:ContentPlaceHolder id=PlaceHolderPageTitle runat="server"/></Title>
    
<SharePoint:CssLink runat="server"/>
    
<SharePoint:Theme runat="server"/>
    
<SharePoint:ScriptLink language="javascript" name="core.js" Defer="true" runat="server"/>
    
<SharePoint:CustomJSUrl runat="server"/>
    
<SharePoint:SoapDiscoveryLink runat="server"/>
    
<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server"/>
    
<SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true"/>
</HEAD>
<BODY scroll="yes" onload="javascript:if (typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();">
  
<form runat="server" onsubmit="return _spFormOnSubmitWrapper();">
   
<!--必选项-->
  
<WebPartPages:SPWebPartManager id="m" runat="Server"/>

  
<table border="1" bordercolordark="white" bordercolor="red" width="100%" cellpadding="0" cellspacing="0">
   
<tr title="第一行">
    
<td>
     
<div style="float:left;">
      
<!--可选项,是头顶那个欢迎信息和登录的控件-->
            
<wssuc:Welcome id="IdWelcome" runat="server" EnableViewState="false"></wssuc:Welcome>
           
</div>
           
<div style="float:right;">
            
<!--可选项,SiteAction那个按钮的控件-->
          
<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>
           
</div>
    
</td>
   
</tr>
   
   
   
<tr title="第二行">
    
<td class="ms-globalTitleArea">
     
<!-- 可選,網站標志圖片 -->
     
<SharePoint:SiteLogoImage id="onetidHeadbnnr0" LogoImageUrl="/_layouts/images/titlegraphic.gif" runat="server"/>
     
<!-- 可選,網站名稱 -->
     
<asp:ContentPlaceHolder id="PlaceHolderSiteName" runat="server">
    
<SharePoint:SPLinkButton runat="server" NavigateUrl="~site/" id="onetidProjectPropertyTitle">
     
<SharePoint:ProjectProperty Property="Title" runat="server" />
      
</SharePoint:SPLinkButton>
     
</asp:ContentPlaceHolder>
    
</td>
   
</tr>
   
   
 
<tr title="第三行">
    
<td  WIDTH=100% class="ms-bannerContainer">
     
<!-- 可選,網站導行菜單 -->
     
<asp:ContentPlaceHolder id="PlaceHolderHorizontalNav" runat="server">
    
<SharePoint:AspMenu
      
ID="TopNavigationMenu"
      Runat
="server"
      DataSourceID
="topSiteMap"
      EnableViewState
="false"
      AccessKey
="<%$Resources:wss,navigation_accesskey%>"
      Orientation
="Horizontal"
      StaticDisplayLevels
="2"
      MaximumDynamicDisplayLevels
="1"
      DynamicHorizontalOffset
="0"
      StaticPopoutImageUrl
="/_layouts/images/menudark.gif"
      StaticPopoutImageTextFormatString
=""
      DynamicHoverStyle-BackColor
="#CBE3F0"
      SkipLinkText
=""
      StaticSubMenuIndent
="0"
      CssClass
="ms-topNavContainer">
     
<StaticMenuStyle/>
     
<StaticMenuItemStyle CssClass="ms-topnav" ItemSpacing="0px"/>
     
<StaticSelectedStyle CssClass="ms-topnavselected" />
     
<StaticHoverStyle CssClass="ms-topNavHover" />
     
<DynamicMenuStyle  BackColor="#F2F3F4" BorderColor="#A7B4CE" BorderWidth="1px"/>
     
<DynamicMenuItemStyle CssClass="ms-topNavFlyOuts"/>
     
<DynamicHoverStyle CssClass="ms-topNavFlyOutsHover"/>
     
<DynamicSelectedStyle CssClass="ms-topNavFlyOutsSelected"/>
    
</SharePoint:AspMenu>
    
<SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource">
     
<Template_Controls>
      
<asp:SiteMapDataSource
        
ShowStartingNode="False"
        SiteMapProvider
="SPNavigationProvider"
        id
="topSiteMap"
        runat
="server"
        StartingNodeUrl
="sid:1002"/>
     
</Template_Controls>
    
</SharePoint:DelegateControl>
     
</asp:ContentPlaceHolder>
    
</td>
   
</tr>
   
   
<!--可选项,设计状态下的控制臺-->     
   
<asp:ContentPlaceHolder ID="WSSDesignConsole" runat="server">
  
<wssuc:DesignModeConsole id="IdDesignModeConsole" runat="server"/>
 
</asp:ContentPlaceHolder>
 
<!--可选项,设计状态下的控制臺面板-->
 
<asp:ContentPlaceHolder ID="SPNavigation" runat="server">
  
<SharePoint:DelegateControl runat="server" ControlId="PublishingConsole"
     PrefixHtml
="&lt;tr&gt;&lt;td colspan=&quot;4&quot; id=&quot;mpdmconsole&quot; class=&quot;ms-consolemptablerow&quot;&gt;"
     SuffixHtml
="&lt;/td&gt;&lt;/tr&gt;">
  
</SharePoint:DelegateControl>
 
</asp:ContentPlaceHolder>

 
<tr title="第四行">
    
<td style="padding:3px;">
     
<table class="ms-main" border="1" bordercolordark="white" bordercolor="black" width="100%"  cellpadding="0" cellspacing="0">
      
<tr>
       
<td  title="第一行第一列" class="ms-titlearealeft">
        
<!-- 可選,頁面圖標 -->
        
<asp:ContentPlaceHolder id="PlaceHolderPageImage" runat="server"/>
       
</td>
       
<td title="第一行第二列" class="ms-titleareaframe">
        
<!-- 可選,一行二欄空格 -->
        
<asp:ContentPlaceHolder id="PlaceHolderTitleLeftBorder" runat="server">
       
&nbsp;
        
</asp:ContentPlaceHolder>
       
</td>
       
<td title="第一行第三列" class='ms-pagetitleareaframe'>
        
<!-- 可選,當前頁面導行 -->
        
<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server">
       
<asp:SiteMapPath SiteMapProvider="SPContentMapProvider" id="ContentMap" SkipLinkText="" NodeStyle-CssClass="ms-sitemapdirectional" runat="server"/> &nbsp;
       
</asp:ContentPlaceHolder>
       
<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" />
       
</td>
       
<td title="第一行第四列" class="ms-titlearearight">
        
<!-- 可選 ,一行四欄空格 -->
        
<asp:ContentPlaceHolder id="PlaceHolderMiniConsole" runat="server"/>
        
<asp:ContentPlaceHolder id="PlaceHolderTitleRightMargin" runat="server">
       
&nbsp;
        
</asp:ContentPlaceHolder>
       
</td>
      
</tr>
      
<tr>
       
<td title="第二行第一列" class="ms-leftareacell" valign="top">
        
<!--可選,左邊菜單 -->
        
<asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server">
       
<!-- 檢視所有網站內容 -->
         
<Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="ViewFormPages">
        
<SharePoint:SPLinkButton id="idNavLinkViewAll" runat="server" NavigateUrl="~site/_layouts/viewlsts.aspx" Text="<%$Resources:wss,quiklnch_allcontent%>" AccessKey="<%$Resources:wss,quiklnch_allcontent_AK%>"/></div>
       
</SharePoint:SPSecurityTrimmedControl>
       
<!-- 選單 -->
       
<Sharepoint:SPNavigationManager Width="150"
        id
="QuickLaunchNavigationManager"
        runat
="server"
        QuickLaunchControlId
="QuickLaunchMenu"
        ContainedControl
="QuickLaunch"
        EnableViewState
="false">
        
<SharePoint:DelegateControl runat="server" ControlId="QuickLaunchDataSource">
         
<Template_Controls>
         
<asp:SiteMapDataSource SiteMapProvider="SPNavigationProvider" ShowStartingNode="False" id="QuickLaunchSiteMap" StartingNodeUrl="sid:1025" runat="server" />
         
</Template_Controls>
        
</SharePoint:DelegateControl>
        
<SharePoint:AspMenu id="QuickLaunchMenu" DataSourceId="QuickLaunchSiteMap" runat="server" Orientation="Vertical" StaticDisplayLevels="2" ItemWrap="true" MaximumDynamicDisplayLevels="0" StaticSubMenuIndent="0" SkipLinkText="">
         
<LevelMenuItemStyles>
          
<asp:menuitemstyle CssClass="ms-navheader" />
          
<asp:menuitemstyle CssClass="ms-navitem" />
         
</LevelMenuItemStyles>
         
<LevelSubMenuStyles>
          
<asp:submenustyle CssClass="ms-navSubMenu1" />
          
<asp:submenustyle CssClass="ms-navSubMenu2" />
         
</LevelSubMenuStyles>
         
<LevelSelectedStyles>
          
<asp:menuitemstyle CssClass="ms-selectednavheader" />
          
<asp:menuitemstyle CssClass="ms-selectednav" />
         
</LevelSelectedStyles>
        
</SharePoint:AspMenu>
       
</Sharepoint:SPNavigationManager>
       
<!-- 資源回收筒 -->
       
<SharePoint:SPLinkButton runat="server" NavigateUrl="~site/_layouts/recyclebin.aspx" id="idNavLinkRecycleBin" ImageUrl="/_layouts/images/recycbin.gif" Text="<%$Resources:wss,StsDefault_RecycleBin%>" PermissionsString="DeleteListItems"/>
      
</asp:ContentPlaceHolder>
       
</td>
       
<td title="第二行第二列">
        
<!-- 可選,二行二欄空格 -->
        
<asp:ContentPlaceHolder id="PlaceHolderBodyLeftBorder" runat="server">
       
&nbsp;
        
</asp:ContentPlaceHolder>
       
</td>
       
<!-- 下面的這個ms-bodyareacell樣式很重要,它確定了內容的高度 -->
       
<td  title="第二行第三列" class='ms-bodyareacell'>
        
<!-- 下面這個也很重要,它確定了WebPart工具欄顯示在內容有右邊 -->
      
<PlaceHolder id="MSO_ContentDiv" runat="server">
       
<table id="MSO_ContentTable" width=100% height="100%" border="0" cellspacing="0" cellpadding="0" class="ms-propertysheet">
         
<tr>
         
<td class='ms-bodyareaframe' valign="top" height="100%">
           
<name="mainContent"></A>
         
<asp:ContentPlaceHolder id="PlaceHolderPageDescription" runat="server"/>
         
<asp:ContentPlaceHolder id="PlaceHolderMain" runat="server">
         
</asp:ContentPlaceHolder>
         
</td>
         
</tr>
       
</table>
      
</PlaceHolder>
       
</td>
       
<td title="第二行第四列" class="ms-rightareacell">
        
<!-- 可選,二行四欄空格 -->
        
<asp:ContentPlaceHolder id="PlaceHolderBodyRightMargin" runat="server">
       
&nbsp;
        
</asp:ContentPlaceHolder>
       
</td>
      
</tr>
    
<tr>
       
<td title="第三行第一列" class="ms-pagebottommarginleft">&nbsp;</td>
       
<td title="第三行第二列" class="ms-pagebottommargin">&nbsp;</td>
       
<td title="第三行第三列" class="ms-bodyareapagemargin">&nbsp;</td>
       
<td title="第三行第四列" class="ms-pagebottommarginright">&nbsp;</td>
      
</tr>
     
</table>
    
</td>
   
</tr>
  
</table>
          
<asp:ContentPlaceHolder id="PlaceHolderFormDigest" runat="server">
 
<SharePoint:FormDigest runat=server/>
</asp:ContentPlaceHolder>
<input type="text" name="__spDummyText1" style="display:none;" size=1/>
<input type="text" name="__spDummyText2" style="display:none;" size=1/>

                  
<!--没用的PlaceHolder不要删除掉,因为有些页面会把东西输出到这些PlaceHolder的,少一个都可能会出错,把他隐藏就行-->
<div style="display:none">
 
<asp:ContentPlaceHolder id="PlaceHolderUtilityContent" runat="server"/>
 
<asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat="server"/>
 
<asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat="server"/>
 
<asp:ContentPlaceHolder id="PlaceHolderGlobalNavigationSiteMap" runat="server">
  
<asp:SiteMapPath SiteMapProvider="SPSiteMapProvider" id="GlobalNavigationSiteMap" RenderCurrentNodeAsLink="true" SkipLinkText="" NodeStyle-CssClass="ms-sitemapdirectional" runat="server"/>
 
</asp:ContentPlaceHolder>
 
<asp:ContentPlaceHolder id="PlaceHolderGlobalNavigation" runat="server"></asp:ContentPlaceHolder>
 
<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server">
  
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox"/>
 
</asp:ContentPlaceHolder>
 
<asp:ContentPlaceHolder id="PlaceHolderTopNavBar" runat="server"></asp:ContentPlaceHolder>
 
<asp:ContentPlaceHolder id="PlaceHolderCalendarNavigator" runat="server" />
 
<asp:ContentPlaceHolder id="PlaceHolderTitleAreaSeparator" runat="server"/>
 
<asp:ContentPlaceHolder id="PlaceHolderLeftActions" runat="server"></asp:ContentPlaceHolder>
 
<asp:ContentPlaceHolder id="PlaceHolderNavSpacer" runat="server"></asp:ContentPlaceholder>
 
<asp:ContentPlaceHolder id="PlaceHolderLeftNavBarBorder" runat="server"></asp:ContentPlaceHolder>
</div>
        
    
</form>
</BODY>
</HTML>

 

 

来源:http://www.cnblogs.com/ceci/archive/2009/08/13/1545144.html

你可能感兴趣的:(master)