“内容查询Web部件-文档"链接在新窗口中打开. [英] Content Query Web Part - Document link open in new window.

查看:83
本文介绍了“内容查询Web部件-文档"链接在新窗口中打开.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的客户需要CQWP来显示来自另一个库的文档,这些文档已被过滤并在新窗口中打开链接.我已经导出了Webpart,并且正在使用自定义的ItemStyles.xsl.我无法获得用于强制打开文档的模板 到新标签页.基本上,链接应将target = _blank作为参考的一部分.

有什么想法吗?

解决方案

有两种方法可以在内容查询Web部件的新选项卡中打开文档.

1.您可以覆盖ItemStyle.xsl以插入" target =" _ blank "用于文档超链接. 

2.您可以使用JQuery设置在新标签页中打开的文档库超链接.

以下代码示例供您参考:

如何覆盖ItemStyle.xsl:

如何使用JQuery在新窗口中设置SharePoint链接打开:

谢谢

王恩(Dean Wang)


My client need the CQWP to display document from another library that are filtered and have the links open in a new window. I have exported out the webpart and am using a custom ItemStyles.xsl. I cannot get the template to force the opening of a document to a new tab. Basically the link should have the target=_blank as part of the reference. 

Any ideas?

解决方案

Hi,

Here are two options to achieve open the document within the new tab in content query web part.

1. You can override ItemStyle.xsl to insert "target="_blank" for the document hyperlink. 

2. You can use JQuery to set the document library hyperlink open in new tab. 

Here are some code samples for your reference:

How to override ItemStyle.xsl:

https://www.benstegink.com/display-link-lists-sharepoint-2013-content-query-web-part/

How to set SharePoint link open in new window using JQuery:

http://blog.scoreman.net/2010/10/open-sharepoint-links-in-new-window-using-jquery/

Thanks,

Dean Wang


这篇关于“内容查询Web部件-文档"链接在新窗口中打开.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆