Drupal Views:在个人资料页面上显示用户最近创建的节点
我想知道如何在用户的个人资料页面上显示用户最近创建的节点。我已经在 /user/%user 为用户创建了一个新页面,我希望能够显示该用户创建的最新节点。
I'm wondering how I can display the recently created nodes by a user on their profile page. I've created a new page for a user at /user/%user and I want to be able to display the latest nodes created by that user.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好的,答案涉及创建一个 drupal 视图,因此您将需要 views 模块,虽然很简单,但答案很长。请耐心等待我...:)(我实际上是在编写说明时在测试站点上执行此操作,以确保我不会错过任何内容...)
我假设您知道如何下载和安装视图模块。确保您还启用了views-ui模块。
默认视图已完成。耶! 添加块
视图现在让我们确保它显示在正确的页面上。
完成!不是火箭科学,而是漫长的过程...drupal 6 视图比 drupal 5 好得多! :)
现在访问用户页面 http://site/users/username 并查看那里显示的表格!
如果您对视图仍有疑问,请联系我。
享受
ok, the answer involves creating a drupal view, so you will need the views module and although simple, the answer is lengthy. please bear with me through this... :) (i am actually doing this on a test site as i write the instructions, to make sure i dont miss anything...)
i assume that you know how to download and install the views module. make sure you also enable the views-ui module.
default view is done. YAY! lets add the block
view is created now lets make sure it shows up on the right pages.
DONE! Not rocket-science, but lengthy process... drupal 6 views is so much better than drupal 5! :)
now go visit a user page http://site/users/username and see the table show up there!
hit me up if you still have questions about views.
enjoy
放入使用 URL 参数中的用户 ID 的视图参数。它将是 arg(1)。这应该会过滤由您正在查看的个人资料创作的内容。这适用于块或内容窗格。
Put in a Views Argument that uses the User ID from the URL argument. It will be arg(1). That should filter content that was authored by the profile you are looking at. That can work for a block or content pane.
我只是更喜欢你去查看 ->对条件进行排序并添加节点:更新日期并将其标记为降序,因为它显示了一段时间内的粒度。
此外,您不仅可以获取表格样式的最新节点,还可以获取所有节点的最新节点。
I just prefer you to go to Views -> Sort Criteria and add the Node:Updated Date and mark it as descending as it shows the granularity over the time.
Moreover, you can also get the most recent node not only to the table style but to all.