简体   繁体   English

如何在当前用户(不是作者)的Drupal中过滤视图

[英]How to filter views in Drupal on current user (not author)

I am a relatively noobe on Drupal and I have hit a problem with Views that I've not been able to resolve by Googling and reading similar questions here. 我是Drupal的一个相对较noobe的人,并且遇到了Views的问题,而我无法通过Google谷歌搜索和在此处阅读类似的问题来解决。

I have ten pages in a content type "Book". 我有十页内容类型为“书”。 I want to encourage users to read all of ten pages. 我想鼓励用户阅读全部十页。 My intention was to create a View that listed specifically for each user which pages they had opened. 我的意图是创建一个视图,该视图专门为每个用户列出了他们打开过的页面。

I can create a View and produce a list of the pages. 我可以创建一个View并生成页面列表。 I can filter the list on Content statistics: Total views (>= 1) to produce a list of pages that have been opened. 我可以过滤“内容统计信息:总视图(> = 1)”中的列表,以生成已打开页面的列表。 --- So far this works predictably and produces the same correct list for three roles: admin, anonymous and logged in user. ---到目前为止,这是可以预期的,并且会为三个角色生成相同的正确列表:管理员,匿名和登录用户。

My difficulty is setting up the filter for current user. 我的困难是为当前用户设置过滤器。 I am aware that the filter for current user does not come up until a relationship is set up. 我知道,直到建立了关系,当前用户的筛选器才会出现。 I have not been able to figure out the correct relationship to make a simple logged in user appear in the filter without being attached to author. 我无法找出正确的关系,以使简单登录的用户出现在过滤器中而不附加到作者。

For further clarification, if it is relevant, the content type is the default book content type. 为了进一步说明,如果相关,则内容类型为默认的书籍内容类型。

I would be grateful if anyone could steer me in the right direction 如果有人能引导我朝正确的方向前进,我将不胜感激

I don't think the content statistics (Total views) keeps a count PER user. 我认为内容统计信息(总观看次数)不会使每个用户数保持计数。

Is there a statistic for instance "visited pages" for users. 是否有针对用户的“已访问页面”的统计信息。 Because you could match that url with the current url. 因为您可以将该网址与当前网址进行匹配。

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

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