最近在自定义DisForm.aspx页面时 发现 创建时间信息无法进行拆分,人事MM只想要修改时间,去掉创建人,创建时间和修改人。

于是我的重新研究下在SPD里面如何去拆分这个时间。

在详情页面上找到的时间信息是如下控件。(默认的DisForm页面没有,这里我是新建了一个列表显示页面)

<SharePoint:CreatedModifiedInfo Visible="false" ControlMode="Display" runat="server"/>

其实就这个东东。但是在转换成html的时候会变成个table,所以我们要分析下里面有什么东西。

问了下其他人,列表的基本模板可以在C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\CONTROLTEMPLATES

的DefaultTemplates.ascx下找到具体对应的数据绑定,查找 CreatedModifiedInfo 大概在485行左右。

<SharePoint:RenderingTemplate id="CreatedModifiedInfo" runat="server">
<Template>
<table cellpadding="" cellspacing="">
<tr><td nowrap="nowrap" class="ms-descriptiontext" id="onetidinfoblock1">
<SharePoint:FormAuthorEditorFormattedString
UserOnlyFormatText="<%$Resources:wss,form_createdby_user%>"
AppOnlyFormatText="<%$Resources:wss,form_createdby_app%>"
UserAppFormatText="<%$Resources:wss,form_createdby_user_app%>"
IsAuthorField="true"
runat="server">
<SharePoint:FormField ControlMode="Display" FieldName="Created" DisableInputFieldLabel="true" runat="server"/>
<SharePoint:FormField ControlMode="Display" FieldName="Author" DisableInputFieldLabel="true" runat="server"/>
<SharePoint:CreationType runat="server"/>
<SharePoint:FormAppInfo ControlMode="Display" FieldName="AppAuthor" runat="server" />
</SharePoint:FormAuthorEditorFormattedString>
</td></tr>
<tr><td nowrap="nowrap" class="ms-descriptiontext" id="onetidinfoblock2">
<SharePoint:FormAuthorEditorFormattedString
UserOnlyFormatText="<%$Resources:wss,form_modifiedby_user%>"
AppOnlyFormatText="<%$Resources:wss,form_modifiedby_app%>"
UserAppFormatText="<%$Resources:wss,form_modifiedby_user_app%>"
IsAuthorField="false"
runat="server">
<SharePoint:FormField ControlMode="Display" FieldName="Modified" DisableInputFieldLabel="true" runat="server"/>
<SharePoint:FormField ControlMode="Display" FieldName="Editor" DisableInputFieldLabel="true" runat="server"/>
<SharePoint:FormAppInfo ControlMode="Display" FieldName="AppEditor" runat="server" />
</SharePoint:FormAuthorEditorFormattedString>
</td></tr>
</table>
</Template>
</SharePoint:RenderingTemplate>

这时,可以发现这个空间也是由许多数据绑定而成,例如

<SharePoint:FormField ControlMode="Display" FieldName="Created" DisableInputFieldLabel="true" runat="server"/>
<SharePoint:FormField ControlMode="Display" FieldName="Author" DisableInputFieldLabel="true" runat="server"/>

上面的代码是显示创建时间和创建人的。
我们回到原来的详细页面设计下。将

<SharePoint:FormField ControlMode="Display" FieldName="Modified" DisableInputFieldLabel="true" runat="server"/>

复制到需要显示的位置。

<tr>
<td width="190px" valign="top" class="ms-formlabel" style="display:none"> <H3 class="ms-standardheader">
<nobr>标题</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody" style="font-family:微软雅黑;font-weight:bolder;font-size:20px;text-align:center"> <xsl:value-of select="@Title"/>
</td>
</tr>
<tr>
<td colspan="" width="400px" valign="top" class="ms-formbody" style="font-family:微软雅黑;font-size:12px;text-align:center">
<SharePoint:FormField FieldName="Modified" runat="server" ControlMode="Display" DisableInputFieldLabel="true"/>
</td>
</tr>
<tr>
<td width="190px" valign="top" class="ms-formlabel" style="display:none"> <H3 class="ms-standardheader">
<nobr>Content</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody"> <xsl:value-of select="@Content" disable-output-escaping="yes"/> </td>
</tr>

具体显示的效果如下

搞定~

收工!

拆分SharePoint 2013 中CreatedModifiedInfo 的时间的更多相关文章

  1. SharePoint 2013中规划企业搜索体系结构

    摘要:了解如何规划小型.中型或大型企业搜索体系结构. 设置企业搜索体系结构之前,需要仔细规划很多事项.我们将逐步帮助您规划小型.中型或大型企业搜索体系结构. 您是否熟悉 SharePoint 2013 ...

  2. SharePoint 2013中修改windows 活动目录(AD)域用户密码的WebPart(免费下载)

    前段时间工作很忙,好久没更新博客了,趁国庆休假期间,整理了两个之前积累很实用的企业集成组件,并在真正的大型项目中经受住了考验:.Net版SAP RFC适配器组件和SharePoint 2013修改AD ...

  3. SharePoint 2013中的爬网最佳做法

    了解在 SharePoint Server 2013 中爬网的最佳做法 搜索系统对内容进行爬网,以构建一个用户可以对其运行搜索查询的搜索索引.本文包含有关如何最有效地管理爬网的建议. 本文内容: 使用 ...

  4. [MSDN] 使用 SharePoint 2013 中的 JavaScript 库代码完成基本操作

    MSDN:http://msdn.microsoft.com/zh-cn/library/jj163201.aspx 了解如何编写代码以在 SharePoint 2013 中使用 JavaScript ...

  5. SharePoint 2013中以其他用户身份登录的WebPart(免费下载)

    在SharePoint 2013中微软并没有提供在SharePoint 2010中以其他用户身份登录的菜单,这对一般用户影响不大,但对于系统管理员或测试人员或特定人员(如在OA系统中的文员或秘书,常常 ...

  6. SharePoint 2013 中自定义WCF服务

    在使用SharePoint2013的时候,如果其他客户端 API 的组合不足,可以通过自定义 Web 服务扩展 SharePoint.默认情况下,SharePoint 2013 不仅支持创建自定义 A ...

  7. 在 SharePoint 2013 中配置 Office Web Apps

    原文发布于 2012 年 7 月 23 日(星期一) 如您所知或您即将知道,SharePoint 2013 中的 Office Web Apps 不再是 SharePoint 场中的服务应用程序.相反 ...

  8. SharePoint 2013 中使用 JavaScript Like 和Unlike list item/page/document

    SharePoint 2013中新增了很多社交功能,比如用户可以like/unlike 任何一个 list item/page/document,这是一个非常不错的功能. 但有时觉得like/unli ...

  9. SharePoint 2013 中的 URL 和标记

    SharePoint 2013 中的 URL 的类型                SharePoint 2013 分析 URL 字符串以基于指定的协议(例如,http:)确定 URL 的格式或确定正 ...

随机推荐

  1. github开发

    从0开始学习 GitHub 系列之「初识 GitHub」 从0开始学习 GitHub 系列之「加入 GitHub」 从0开始学习 GitHub 系列之「Git 速成」 从0开始学习 GitHub 系列 ...

  2. python:Django

    Python的WEB框架有Django.Tornado.Flask 等多种 web框架本质 众所周知,对于所有的Web应用,本质上其实就是一个socket服务端,用户的浏览器其实就是一个socket客 ...

  3. 一个jQ版大图滚动

    难得周末能休息,也是越发的代码难受,手就想敲点东西,这不闲着无聊敲了一个Jq版的大图滚动,不足之处大家批评指正: 运作环境win7,代码编辑器是:sublime; 我把源码复制了一下, <!do ...

  4. Instantaneous Transference--POJ3592Tarjan缩点+搜索

    Instantaneous Transference Time Limit: 5000MS Memory Limit: 65536K Description It was long ago when ...

  5. Life is short

    相信不少码农曾看过类似“life is short, use Python”等之类略带调侃意味的小段子(譬如我),而其也并非不无道理.每门编程语言都是合理的存在,都有它们的优点,及缺陷. 码农们也大多 ...

  6. Android多媒体--MediaCodec 中文API文档

    *由于工作需要,需要利用MediaCodec实现Playback及Transcode等功能,故在学习过程中翻译了Google官方的MediaCodec API文档,由于作者水平限制,文中难免有错误和不 ...

  7. jQuery事件总结

    blur() 触发或绑定blur事件.$("input").blur(function(){ $("input").css("background-c ...

  8. 对teacher表进行增加,删除,修改

    <%@page import="java.text.SimpleDateFormat"%> <%@ page language="java" ...

  9. python走起之第九话

    协程 协程,又称微线程,纤程.英文名Coroutine.一句话说明什么是线程:协程是一种用户态的轻量级线程. 协程拥有自己的寄存器上下文和栈.协程调度切换时,将寄存器上下文和栈保存到其他地方,在切回来 ...

  10. C# 实现 Excel文件的数据导入

    前台 <asp:FileUpload ID="fuFile" runat="server" /> 后台 public string GetExcel ...