Drupal 6 - 如何设置 VIEWS 块?
我不知道如何在 Drupal 6 中为此设置块视图:
用户提交图片。如果获得批准,我会将其上传到网站。
有一个节点显示图片的详细信息和作者信息。我想要一个块,上面写着“更多作者的作品”。该块将列出该作者提交的更多图像。我该怎么做?
URL 是:mysite/content/name-of-image,所以我不知道如何创建一个显示该作者的所有图像的视图,因为用户名不在 URL 中。有人可以告诉我该怎么做吗?
谢谢。
I can't figure out how to set up a block view for this in Drupal 6:
Users submit a picture. If it is approved, I upload it to the site.
There is a node that shows the details of the picture and the author information. I want to have a block that says, MORE BY THIS AUTHOR. This block would list more images that this author has submitted. How can I do this?
The URL is: mysite/content/name-of-image so I don't know how to create a view that shows all the images by this author since the user name is not in the URL. Can someone tell me how to do this?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
输入以下 php 代码:
在您的情况下,您需要来自节点的 cck 字段的 uid,因此 php 代码应该是这样的:
现在您将从 url 中的节点获得作者用户 id 。
现在,您可以从该作者创建的节点向视图添加字段。
注意:视图预览不会显示任何结果,因此您必须保存此视图并在视图生成器外部对其进行测试。
enter following php code:
in your case you want the uid from a cck field of the node, so the php code should be this:
Now you'll have the author user id from the node in url.
Now you can add fields to the view from nodes created by this author.
NOTE: the view preview won't show any results, so you'll have to save this view and test it outside the views builder.