最近在自定义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. Node.js入门教程:Node.js如何安装配置并部署第一个网站

    前言:作为一个资深的前端开发人员,不懂的Node.js 那你绝对是不能跟别人说你是资深的前端程序猿滴! 今天洋哥就来和大家一起学习被大牛称之为前端必学的技能之一Node! 那么Node到底是什么呢? ...

  2. Http状态码(转)

    什么是Http状态码?(转自http://bbs.tui18.com/thread-11597640-1-1.html) 百度百科上解释为:HTTP状态码(HTTP Status Code)是用以表示 ...

  3. webpack配置技巧--路径

    resolve: { extensions: ['', '.js', '.vue'], fallback: [path.join(__dirname, '../node_modules')], ali ...

  4. python 随机生成固定长度的字串

    from random import Random#随机生成4到20位的用户名def random_username(): username = '' chars = 'AaBbCcDdEeFfGgH ...

  5. .net 之缓存

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  6. Is the Information Reliable? -POJ2983差分约束

    Time Limit: 3000MS Memory Limit: 131072K Description The galaxy war between the Empire Draco and the ...

  7. Python,Jupyter Notebook,IPython快速安装教程

    0.安装环境 Windows10,Python3.5.1,IPython,jupyter notebook,and other functionality 官方安装文档Linux版3.x 官方安装文档 ...

  8. itput

    这个网站也非常好,有很多金融it知识免费下载,下载验证码t7QA,名字新共产主义

  9. ubuntu 14.04 vsftpd安装问题

    sudo apt-get install vsftpd; 打开允许访问用户名 local_enable=YES write_enable=YES chroot_list_file=/etc/vsftp ...

  10. iOS的多版本配置(版本分离,多环境配置)

    前几天公司说一个客户要搞一个app,我说搞呗,跟我啥关系...他说,就是从咱的app上搞,什么都一样,就是一些logo啥的不一样.我一开始感觉,那就改改logo呗,后来一想,凑,百度推送,友盟统计,B ...