拆分SharePoint 2013 中CreatedModifiedInfo 的时间
2024-10-15 10:48:34
最近在自定义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>
具体显示的效果如下
搞定~
收工!
最新文章
- python des ecb 加密 demo
- C++ 11 lambda
- SOM自组织映射网络 教程
- 【git】删除某个文件的所有历史记录,批量删除远程分支
- web 模板 类似京东左侧的导航栏
- (转载)Android content provider基础与使用
- objective-c中使用cocoa的NSPredicate,谓词(十四)
- ASP.NET工具
- 基础总结篇之五:BroadcastReceiver应用具体解释
- Redis 密码设置和登录
- php的表单安全处理
- 我做的第一个程序(菜鸟的java课堂笔记)
- 关于MATLAB收集人工鼠标移动轨迹的坐标
- Linux学习之Centos(三)------系统文件目录及含义详解
- TCP/IP协议 数据链路层
- Ubuntu16.04下搭建Go语言环境
- [leetcode]449. Serialize and Deserialize BST序列化反序列化二叉搜索树(尽量紧凑)
- Python中的高级turtle(海龟)作图
- Homebrew 使用指南
- 23.如何查看一个keystore的具体签名信息
热门文章
- 分享一个很早之前写的小工具DtSpyPlus
- Uva 11354 LCA 倍增祖先
- Codeforces Round #389 (Div. 2, Rated, Based on Technocup 2017 - Elimination Round 3) C
- 据说年薪30万的Android程序员必须知道的帖子
- python 学习笔记十七 django深入学习二 form,models
- android HAL 教程(含实例)
- 3.UIViewController详解
- Linux就该这么学
- 基础笔记10(IO 1.7try-with-resource) 装饰模式
- UML图