drupal 视图对这个用例有用吗

2021-12-29 00:00:00 php drupal drupal-views

我有一个要呈现给用户的节点列表.然后用户选择 3,我需要记住这个决定,以便稍后我可以将它们显示在一个较小的列表中(您的选择列表).

I have a list of nodes that I want to present to the user. The user then picks 3 and I need to remember that decision so I can present them in a smaller list later (your choices list).

为了显示节点的完整列表,我将仅使用视图来获取所有已发布的节点.

To present the full list of nodes, I will just use views to get all published nodes.

问题是我如何存储这 3 个选择,以便我可以将它们拉到您的选择列表"中?我应该使用什么结构来保存它们?创建一个名为 list 的内容类型或使用视图.不确定,或者这个用例有更合乎逻辑的东西?

The question is how do I store those 3 choices so I can pull them in the "your choices list"? What structure should I use to save them? create a content type called list or use views. Not sure, or there's something more logical for this use case?

推荐答案

你肯定想仔细看看 标志模块.它为标记"(或标记)节点、用户和评论以及良好的视图集成提供了一个灵活的系统.

You most definitely want to take a closer look at the Flag module. It provides a flexible system for 'flagging' (or marking) nodes, users and comments, along with good views integration.

使用它,您可以创建一个收藏夹"标志,将其设置为每个用户",您的用户可以使用它来标记节点.通过视图集成,您可以通过多种方式在这些标志上创建自定义视图过滤,因此您可以轻松创建显示这些收藏夹的页面和块.

Using this, you could create a flag 'favorite', set it as 'per user' and your users can use this to mark nodes. With the views integration, you can create custom views filtering on those flags in many ways, thus you can easily create pages and blocks that display those favorites.

我不确定它是否支持限制,例如每个用户开箱即用的三个标志,但它也带有一个 API,所以你应该能够影响这样的事情(虽然不能保证;)

I'm not sure if it supports a limitation to e.g. three flags per user out of the box, but it also comes with an API so you should be able to influence things like that (no guarantee, though ;)

您可能还想检查以下内容,但我没有使用它们的经验,所以不知道它们是否合适和/或符合您的要求:

You might also want to check the following, but I have no experience using them, so no idea if they are good and/or fit your bill:

  • 收藏节点模块
  • 收藏夹模块

相关文章