如何在SharePoint Blog中显示附件(Attachement file)
2010-05-13 16:07
465 查看
参考了一个博客(http://www.pampigt.se/?p=69),其中自己也下了不少功夫,主要是对SharePoint Designer中Data view的使用方法不熟悉,走了些弯路,但终于还是搞定了。贡献给大家,应该也算是个原创吧。
1. 在NewPost画面增加Attach File按钮。
修改文件:C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\SiteTemplates\Blog\Lists\Posts\schema.xml。
将以下内容
代码
<xsl:when test="@Attachments=''"></xsl:when>
<xsl:otherwise>Attachments:
<xsl:if test="not (@Attachments=0)">
<xsl:element name="SharePoint:AttachmentsField">
<xsl:attribute name="runat">server</xsl:attribute>
<xsl:attribute name="ListId">{AC915FEE-C3BE-4102-8D84-75A384A327A2}</xsl:attribute>
<xsl:attribute name="FieldName">Attachments</xsl:attribute>
<xsl:attribute name="ControlMode">Display</xsl:attribute>
<xsl:attribute name="Visible">true</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:otherwise>
注意:ListId要替换为自己网站内的ListId。
保存Post.aspx。
至此,大功告成。重新在IE下打开Post.aspx,将会看到原来附件图标不见了,取而代之的是附件的链接。有多个附件时,将以多行显示。
1. 在NewPost画面增加Attach File按钮。
修改文件:C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\SiteTemplates\Blog\Lists\Posts\schema.xml。
将以下内容
代码
<xsl:when test="@Attachments=''"></xsl:when>
<xsl:otherwise>Attachments:
<xsl:if test="not (@Attachments=0)">
<xsl:element name="SharePoint:AttachmentsField">
<xsl:attribute name="runat">server</xsl:attribute>
<xsl:attribute name="ListId">{AC915FEE-C3BE-4102-8D84-75A384A327A2}</xsl:attribute>
<xsl:attribute name="FieldName">Attachments</xsl:attribute>
<xsl:attribute name="ControlMode">Display</xsl:attribute>
<xsl:attribute name="Visible">true</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:otherwise>
注意:ListId要替换为自己网站内的ListId。
保存Post.aspx。
至此,大功告成。重新在IE下打开Post.aspx,将会看到原来附件图标不见了,取而代之的是附件的链接。有多个附件时,将以多行显示。
相关文章推荐
- Moss/Sharepoint 如何自定义显示界面以及字段
- 如何让SharePoint Service 3.0显示真正的错误原因
- [转]如何删除放置库(How to Delete the Drop Off Library)in SharePoint 2010
- 如何卸载 SharePoint Workspace 2010
- Linq to Sharepoint--如何获取Linq Query 生成的CALM
- 如何通过编程访问Windows SharePoint Services 3.0中的列表文件夹
- sharepoint 2016 学习系列篇(2)-如何部署sharepoint server 2016(1)-AD域服务器安装和部署
- 如何从SharePoint Server 2016 Beta2升级到RC版本?
- 如何手动删除 SharePoint Portal Server
- 如何快速备份SharePoint Farm Solution
- 如何结合SharePoint Designer 2010 与Visio 2010 创建工作流?
- 如何使用CAML 批量更新SharePoint List
- SharePoint Tips and Tricks --如何用JS向PeopleEditor填充数据
- Sharepoint online 如何使用asp.net开发项目!!!
- Wss3入门(4):必备功能:给SharePoint Blog添加热门标签(Tags Cloud)
- 使用SharePoint Designer(一)-对List的显示应用Conditional Formating
- 如何解决Sharepoint Digest 超时问题
- 如何使用本地账户"完整"安装 SharePoint Server 2010
- Sharepoint学习笔记---Linq to Sharepoint--如何获取Linq Query 生成的CALM
- SharePoint Server 2013 Excel Web Access无法显示