简体   繁体   English

Drupal将内容配置文件用户视为参数

[英]Drupal Views Content Profile User as an argument

I have a normal Drupal User. 我有一个普通的Drupal用户。 I have used the content_profile module to create a profile content type. 我已经使用content_profile模块来创建配置文件内容类型。 This content type contains a node reference to another content type company. 此内容类型包含对另一个内容类型公司的节点引用。 The company node then references a type of node called Task. 然后,公司节点引用一种称为Task的节点类型。

I want to create a view that list all the tasks for a given user id. 我想创建一个视图,该视图列出给定用户ID的所有任务。 So I imagine I would create a view with an argument of user id. 所以我想我会创建一个带有用户ID参数的视图。 Then I would add the relationship to the profile and the company and output the Task title. 然后,将关系添加到配置文件和公司中,并输出任务标题。

The user id used seems to work on the created used ID and not the user id of the content profile that it is referencing. 所使用的用户ID似乎适用于创建的已使用ID,而不是它所引用的内容概要文件的用户ID。 In our system the "admin" user creates the profiles so it causing some problems. 在我们的系统中,“管理员”用户创建了配置文件,因此会引起一些问题。

Any ideas? 有任何想法吗? I feel I may need to write a custom module to do what I want. 我觉得我可能需要编写一个自定义模块来完成我想要的事情。

i have answered a similar question in the past about how to create a view using part of the url as an argument to filter the view by the user profile. 过去我曾回答过一个类似的问题,关于如何使用部分url作为自变量来过滤用户个人资料视图的视图。 check out this url . 检查这个URL the answer you are looking for may be a variation of my original response. 您正在寻找的答案可能是我原始回复的变体。

also, how are you creating those profiles? 另外,您如何创建这些配置文件? on one of my sites, when i created the profile page, its author ID is automatically changed to the user it is associated with. 在我的一个网站上,当我创建个人资料页面时,其作者ID自动更改为与之关联的用户。

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

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