惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Help Net Security
Help Net Security
G
Google Developers Blog
雷峰网
雷峰网
WordPress大学
WordPress大学
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Engineering at Meta
Engineering at Meta
Security Latest
Security Latest
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
F
Full Disclosure
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
J
Java Code Geeks
U
Unit 42
C
Cyber Attacks, Cyber Crime and Cyber Security
V
V2EX
C
Cisco Blogs
博客园 - 司徒正美
Project Zero
Project Zero
L
LINUX DO - 热门话题
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
Scott Helme
Scott Helme
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog
S
Securelist
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
S
Schneier on Security
G
GRAHAM CLULEY
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyberwarzone
Cyberwarzone
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
T
Threatpost
Recorded Future
Recorded Future
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
The Register - Security
The Register - Security
S
Security Archives - TechRepublic
博客园 - Franky
N
News | PayPal Newsroom
Simon Willison's Weblog
Simon Willison's Weblog
S
SegmentFault 最新的问题
W
WeLiveSecurity
A
Arctic Wolf
B
Blog

博客园 - heli猫

修改infopath样式的小技巧(如何让文本框自适应文字多少?) 我在ABC公司的第一个项目 -- 编了个小故事,讲讲我理解的软件生命周期模型 用js调用ActiveX发outlook的meeting request的方法 - heli猫 - 博客园 如何解决带托管代码的infopath表单上传中的“正在删除”问题 通过代码 操作 sharepoint 讨论版 (转) - heli猫 IT项目经理经验谈 - 如何谈判 WSS、SharePoint 2003、MOSS、SharePoint 2009 大比对(5) WSS、SharePoint 2003、MOSS、SharePoint 2009 大比对(4) WSS、SharePoint 2003、MOSS、SharePoint 2009 大比对(3) WSS、SharePoint 2003、MOSS、SharePoint 2009 大比对(2) WSS、SharePoint 2003、MOSS、SharePoint 2009 大比对(1) MOSS数据库扩展设计方案 MOSS和其他系统的数据集成方式 MOSS站点的优化方案(结合kaneboy的文档) SharePoint应用场景介绍(一) 推荐一篇有用文章:创建Feature扩展SharePoint列表项或文档的操作菜单项 对象的当前状态使该操作无效 or SPListItem Update Operation is not valid due to the current state of the object 在两个不信任的域或两台独立服务器中安装SharePoint MOSS母版页制作学习笔记(二)
MOSS母版页制作学习笔记(一)
heli猫 · 2008-08-15 · via 博客园 - heli猫

母版页制作其实应该算是一个比较基础的工作,但是熟练制作出灵活、完整的母版页的人却很少。。为什么会这样呢,分析原因有几个,主要的问题应该是母版页制作是介于开发和美工之间的工作,开发人员关注代码,美工关注界面效果,就忽略和回避了这部分,都不愿意作怎么办,那就我来作吧。。

首先MOSS的母版页也是来自于asp.net的母版页,原理都是一样的。

基于微软提供的文档,母版页制作有两种方式:一,布局变化不大的情况下,在原母版页上修改;二,重新制作。

我们主要说说重新制作吧。。

最简单的理解就是:

第一,先知道哪些是母板页中必须有的元素;

第二,从美工处拿到界面的展示效果和html布局,css样式表;

第三,从SPD创建一个新的母版页,将html代码复制进去;

第四,将css放到相应位置,母版页应用对应的css;

第五,将美工模拟的控件用母版页中的占位符替换;

第六,除了必须的元素外,还需要添加什么附加控件,也加到相应的位置;

完成!

下面详细说下每一步:

一、哪些是母板页中必须有的元素

空白的,没有样式的包括所有占位符的母版页:

<%-- Identifies this page as a .master page written in 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"/>
  <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>
  <body onload="javascript:_spBodyOnLoadWrapper();">
    <form runat="server" onsubmit="return _spFormOnSubmitWrapper();">
      <wssuc:Welcome id="explitLogout" runat="server"/>
      <PublishingSiteAction:SiteActionMenu runat="server"/> 
      <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:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat ="server"/>
<asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat ="server"/>
</asp:Panel>
    </form>
  </body>
</html>

然后我们来分别认识下这些占位符:

1、<asp:ContentPlaceHolder ID="PlaceHolderGlobalNavigationSiteMap" 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>
2、<asp:ContentPlaceHolder ID="PlaceHolderGlobalNavigation" runat="server" />
放置顶部一行内容的占位符;一般中间可以加上表格,并放上需要的东西,例如欢迎信息,我的站点等。例如欢迎信息:

<asp:ContentPlaceHolder ID="PlaceHolderGlobalNavigation" runat="server">
<wssuc:Welcome id="IdWelcome" runat="server" EnableViewState="false"></wssuc:Welcome> </asp:ContentPlaceHolder>
欢迎信息也可以单独拿出来放在其他位置。


3、<asp:ContentPlaceHolder ID="PlaceHolderSiteName" runat="server" />
放置LOGO旁边的大的站点名称的占位符;中间加了内容的默认写法是:

<SharePoint:SPLinkButton runat="server" NavigateUrl="~site/" id="onetidProjectPropertyTitle">
    <SharePoint:ProjectProperty Property="Title" runat="server" />
</SharePoint:SPLinkButton>

待续》》