简体   繁体   English

Sharepoint 2010:跟踪对链接到文档内容类型的单击:使用jQuery在自定义列表中存储和更新值。

[英]Sharepoint 2010: Tracking Clicks on Link to a Document Content Type: Store and Update Values in a Custom List by using jQuery.

Due to several system limitations (IE8, structure of our sharepoint setup, etc...) we are unable to use the standard site analytics webpart featured in SP2010 to generate a ranking of most viewed files within any given scope of a site collection. 由于一些系统限制(IE8,我们的共享点设置的结构等),我们无法使用SP2010中提供的标准网站分析Web部件来生成网站集任何给定范围内查看最多的文件的排名。 Additionaly, all of our sharepoint libraries that are publicly visible are only accessible by means of a shortcut, ie they are all of the "link to a document file type". 另外,我们所有公开可见的共享点库都只能通过快捷方式访问,即它们都是“指向文档文件类型的链接”。 I was wondering, if anyone has experience in accomplishing the following by means of jQuery or Javascript: 我想知道,是否有人有通过jQuery或Javascript完成以下操作的经验:

  1. Register Click on any given "Link to a Document" within any Library of a given page 注册在给定页面的任何库中单击任何给定的“链接到文档”
  2. If it is the first time that link was clicked on: Store Name of the File Shortcut in a previously created list and set "nr. of clicks" value to 1 如果是第一次单击链接,请执行以下操作:将文件快捷方式的名称存储在以前创建的列表中,并将“点击次数”值设置为1
  3. Anytime a shortcut is clicked on again: update the value (=Nr. of clicks) in the created custom list. 每次再次单击快捷方式:更新创建的自定义列表中的值(=点击数)。
  4. Sort the list by most frequently clicked shortcuts. 按最常单击的快捷方式对列表进行排序。

The goal is to provide users with a top 10 list regarding most frequently viewed files on any given sharepoint site. 目标是向用户提供有关任何给定共享点站点上最常查看的文件的前十名列表。

Thanks upfront for any support at all! 非常感谢您的全力支持!

I would create a JavaScript file and reference it in the master page you are using to accomplish what you just described. 我将创建一个JavaScript文件,并在您用来完成您刚刚描述的内容的母版页中引用它。

Register an event on the button click, find the item in the list with the url of the link to new item, if it exists, add 1 to them value of clicks, if not then create the item with value of Clicks to 1. 在按钮单击上注册一个事件,在列表中找到具有新项目链接的URL的项目(如果存在),向其添加1的clicks值,如果不存在,则创建Clicks值为1的项目。

The sorting would be achieved by creating a view (in list settings) which sorts the list by the value of clicks, descending. 可以通过创建一个视图(在列表设置中)来实现排序,该视图按点击值(降序)对列表进行排序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM