Create a Custom Master Page

Solusion 1:

First:Open site with sharepoint designer,expand "_catalogs--masterpage".Right click new---sharepoint content(Tab page).Then drag it to "_catalogs--masterpage" file.

 

Second:Select master page.Then copy code from "BlueBand.master",then Modified.OK

 

Third:IISRESET

 

Sample:

First:Create a document library called "XSL Style Sheets".Upload Img01.jpg,Img02.jpg,TopNav.xml,TopNav.xsl into "XSL Style Sheets".(Img01.jpg,Img02.jpg in my pic)

 

Second:

Master Page Source Code

 

 <%@Master language="C#"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ 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" %>
<%@ 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="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="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" %>

<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">
 
 <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" οnlοad="javascript:if (typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();">
  <form runat="server" οnsubmit="return _spFormOnSubmitWrapper();">
 <WebPartPages:SPWebPartManager id="m" runat="Server"/>
 <SharePoint:RobotsMetaTag runat="server"/>
 <wssuc:Welcome id="explitLogout" runat="server"/>
 <table class="Topnav">
 <tr><td>
 <WebPartPages:DataFormWebPart runat="server" IsIncluded="True" FrameType="None" NoDefaultStyle="TRUE" ViewFlag="0" Title="XSL Style Sheets/TopNav.xml" __markuptype="vsattributemarkup" __WebPartId="{C224649D-B87C-4B53-B6AD-7FC6589F6D4C}" id="g_c224649d_b87c_4b53_b6ad_7fc6589f6d4c" __AllowXSLTEditing="true" WebPart="true" Height="" Width="">
 <DataSources>
  <SharePoint:SPXmlDataSource runat="server" id="XSL_x0020_Style_x0020_Sheets_x002f_TopNav_x002e_xml1"><DataFileParameters><WebPartPages:DataFormParameter Name="FileName" ParameterKey="FileName" PropertyName="ParameterValues" DefaultValue="TopNav.xml"/><WebPartPages:DataFormParameter Name="FilePath" ParameterKey="FilePath" PropertyName="ParameterValues" DefaultValue="XSL%20Style%20Sheets"/></DataFileParameters></SharePoint:SPXmlDataSource>
 </DataSources>
 <ParameterBindings>
  <ParameterBinding Name="FileName" Location="None" DefaultValue="TopNav.xml"/>
  <ParameterBinding Name="FilePath" Location="None" DefaultValue="XSL%20Style%20Sheets"/>
  <ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
  <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
  <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
 </ParameterBindings>
 <datafields>@MenuId,MenuId;@Name,Name;@Url,Url;@AutoExpand,AutoExpand;</datafields>
 <XSL/><XslLink>/XSL Style Sheets/TopNav.xsl</XslLink>
</WebPartPages:DataFormWebPart>
  </td></tr>
 <tr><td>
  <PublishingSiteAction:SiteActionMenu runat="server"/>
 </td></tr>
 </table>

<PublishingWebControls:AuthoringContainer id="authoringcontrols" runat="server">
<PublishingConsole:Console runat="server" />
</PublishingWebControls:AuthoringContainer>
<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:Panel>
  <asp:ContentPlaceHolder id="PlaceHolderUtilityContent" runat="server"/>
 <asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat="server"/>
 <asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat="server"/>
  </form>
  </BODY>
</HTML>

 

TopNav.xml

<?xml version="1.0" encoding="utf-8" ?>
<SiteMap>
 <ImageNode ImageId="logoimage" Url="/pages/homepage.aspx" AutoExpand="false"/>

 <MenuNode MenuId="1" Name="VideoPage" Url="/pages/VideoPage.aspx" AutoExpand="false"> 
 </MenuNode>

 <MenuNode MenuId="2" Name="ImagePage" Url="/pages/ImagePage.aspx"  AutoExpand="false">
 </MenuNode>

 <MenuNode MenuId="3" Name="BeautyPage" Url="/Pages/BeautyPage.aspx"  AutoExpand="false">
 </MenuNode>

 <MenuNode MenuId="4" Name="SmartPage" Url="/Pages/SmartPage.aspx" AutoExpand="false">
 </MenuNode>

 <MenuNode MenuId="5" Name="Reporting" Url="/Pages/Reporting.aspx"  AutoExpand="false">
 </MenuNode>

 <MenuNode MenuId="6" Name="Smartphone" Url="/Pages/Smartphone.aspx"  AutoExpand="false">
 </MenuNode>

</SiteMap>

 

TopNav.xsl

<xsl:stylesheet version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">

  < xsl:output method =" html " indent =" no " />
  < xsl:decimal-format NaN ="" />
  < xsl:param name =" FileName " />
  < xsl:param name =" dvt_apos "> ' </ xsl:param >
  < xsl:variable name =" dvt_1_automode "> 0 </ xsl:variable >
- < xsl:template match =" / " xmlns:asp =" http://schemas.microsoft.com/ASPNET/20 " xmlns:__designer =" http://schemas.microsoft.com/WebParts/v2/DataView/designer " xmlns:SharePoint =" Microsoft.SharePoint.WebControls ">
  < xsl:call-template name =" dvt_1 " />
  </ xsl:template >
- < xsl:template name =" dvt_1 ">
  < xsl:variable name =" dvt_StyleName "> Table </ xsl:variable >
  < xsl:variable name =" Rows " select =" /SiteMap/MenuNode " />
  < script type =" text/javascript "> function LogoClick(url) { window.location = url; } </ script >
- < table border =" 0 " width =" 100% " cellpadding =" 2 " cellspacing =" 0 ">
- < xsl:call-template name =" dvt_1.body ">
  < xsl:with-param name =" Rows " select =" $Rows " />
  </ xsl:call-template >
  </ table >
  </ xsl:template >
- < xsl:template name =" dvt_1.body ">
  < xsl:param name =" Rows " />
- < tr >
- < td >
  < xsl:variable name =" ImageNodes " select =" /SiteMap/ImageNode " />
  < xsl:variable name =" UrlVal " select =" $ImageNodes/@Url " />
  < img style =" cursor:hand " onclick =" LogoClick('{$UrlVal}') " src =" /XSL Style Sheets/Img01.jpg " width =" 232 " height =" 89 " />
  </ td >
- < xsl:for-each select =" $Rows ">
  < xsl:call-template name =" dvt_1.rowview " />
  </ xsl:for-each >
- < td >
  < img src =" /XSL Style Sheets/Img02.jpg " width =" 237 " height =" 85 " />
  </ td >
  </ tr >
  </ xsl:template >
- < xsl:template name =" dvt_1.rowview ">
- <!--
		<xsl:if test="position() mod 2 = 1">
				<xsl:attribute name="class">ms-alternating</xsl:attribute>
			</xsl:if>
			<xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
				<td class="ms-vb" width="1%" nowrap="nowrap">
					<span ddwrt:amkeyfield="" ddwrt:amkeyvalue="string($XPath)" ddwrt:ammode="view"></span>
				</td>
			</xsl:if>
  -->
- < td class =" ms-vb ">
- < a id =" anchor{@MenuId} " href =" {@Url} ">
  < xsl:value-of select =" @Name " />
  </ a >
  </ td >
  </ xsl:template >
  </ xsl:stylesheet >
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值