如何从URL获取文档库名称 [英] How to obtain document library name from the URL
问题描述
如何从URL cqwp获取文档库名称.例如,
How to obtain document library name from the URL cqwp. For example,
http:///sites/site1/DocLib/Forms/AllItems.aspx
我知道xsl有子字符串功能
I know there is substring function with xsl
<xsl:param name="DocLibName">
select=substring(url) or whatever the code should be
</xsl:param>
推荐答案
- 一些很好的链接.
http://msdn.microsoft.com/zh-cn/library/dd583143(office.11).aspx
- 添加这两行
<xsl:variable name="DocLibName" select="substring-before(substring-after($PageUrl, '/Forms/'), '/')" />
<xsl:param name="PageUrl"/>
-
设置VIEWFLAG = 1(应该在属性窗口中)
set VIEWFLAG=1 (it should be in the properties windows)
查找此行并修改是否要过滤Webpart列表
Find this line and modify if you want Filter the webpart list
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row" />
将其更改为以下内容
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[(@CustomerNo=$DocLibName)]"/>
您可以使用它来显示
<xsl:value-of select="$DocLibName"> <br/>
<xsl:value-of select="$PageUrl"/><br/>
这篇关于如何从URL获取文档库名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!