如何从 Drupal 视图中的表中的用户引用中添加带有 UID 的链接
我在 Drupal 6 中有以下内容:
- 主 CCK 类型,其中包含用户参考字段和其他字段。这里每个用户只有一条记录。
- 此 CCK 的视图,显示为表格,其中字段之一是来自 CCK 类型的用户引用。该字段最初显示为用户名,链接到用户配置文件。
- 第二个 CCK 类型,可以包含有关特定用户的多条数据。
- 此 CCK 类型的视图,以表格形式显示信息。它将用户 ID 作为参数(整数)
我想单击主视图中的用户名,然后定向到该用户的详细视图。为此,我尝试在用户字段上选择“将此字段输出为链接”。我可以替换的内容是:
Fields
* [field_my_user_ref_uid_1] == Content: User (field_my_user_ref)
Arguments
* %1 == User: Uid
但是, [field_my_user_ref_uid_1] 元素被用户名替换,并且 %1 似乎被空字符串替换。我怎样才能把用户ID放在这里呢?
I have the following in Drupal 6:
- A Master CCK type which contains a User reference field and other fields. There will only be one record per user here.
- A View of this CCK, shown as a table, with one of the fields being the user ref from the CCK type. This field is initially shown as a user name, linking to the user profile.
- A Second CCK type which can have several pieces of data about a particular user.
- A View for this CCK type, displaying information as a table. It takes a user id as an argument (an integer)
I want to click on the user name in the master view, and be directed to the detail view for this user. To do this, I tried selecting 'Output this field as a link' on the user field. The thing available for me to replace are:
Fields
* [field_my_user_ref_uid_1] == Content: User (field_my_user_ref)
Arguments
* %1 == User: Uid
However, the [field_my_user_ref_uid_1] element is replaced by the user name, and %1 seems to get replaced with an empty string. How can I put the user id in here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我不确定执行此操作的正确方法是什么,但我正在解决它,我似乎正在解决所有视图问题:通过向其抛出 jquery 。
目前,“用户引用”字段已经有一个与用户 ID 的链接,因此我已将其添加到页脚中:
我讨厌我必须这样做,但我确实喜欢 jquery。
Well, I'm not sure what the right way to do this is, but I'm solving it the hacky way I seem to be solving all my Views problems: by throwing jquery at it.
Currently, the User Ref field already has a link with the user id, so I've added this to the footer:
I hate that I have to do it like this, but I sure do love jquery.