Drupal OG 视图:无法创建我当前*不*成员的所有组的视图

发布于 2024-08-07 00:24:02 字数 417 浏览 9 评论 0原文

(也发布为 http://drupal.org/node/596860

我想创建一个视图仅显示我还不是其成员(或待定成员)的群组。但是,执行此操作的明显方法(获取 og_my 视图并将过滤器“有机组:组成员”更改为 false)不起作用。

原因是 SQL 查询本质上为组中与您的条件匹配的每个用户返回一行。如果您正在搜索自己(如 og_my 中),每个组节点只会显示一次;如果您不搜索自己,则每个组节点都会显示 N 次,其中 N 是其他组成员的数量。因此,只要至少还有一名其他成员,我已经是其成员的组就会继续显示。

有人有办法解决这个问题吗?

谢谢,阿德里安

(Also posted as http://drupal.org/node/596860)

I would like to create a view showing only those groups of which I am not already a member (or a pending member). However, the obvious way of doing this (take the og_my view and change the filter "Organic groups: Group member" to false) does not work.

The reason is that the SQL query essentially returns one row for every user in the group that matches your conditions. If you're searching for yourself (as in og_my), each group node will only show up once; if you're not searching for yourself, each group node shows up N times, where N is the number of other group members. Thus the groups of which I'm already a member continue to be displayed as long as there's at least one other member.

Does anyone have a way around this?

Thanks, Adrian

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏雨凉 2024-08-14 00:24:02

您可能无法直接在视图中实现此目的,因为它不支持子查询。我的 SQL 的结果如下:

SELECT node.nid AS nid, node.title AS node_title  FROM node node   LEFT JOIN og_uid og_uid ON node.nid = og_uid.nid  WHERE (node.type IN ('campaign','setting','system')) AND node.nid NOT IN (select nid from og_uid where uid = 1);

据说您可以以编程方式将此类查询的结果转发到视图系统中进行主题化。

也许对参数有机组的特殊处理:组的成员,排除参数选项?

我还发布了“待办事项”,希望能够推动问题对话的进展。

You may not be able to achieve this in Views directly as it does not support subqueries. My SQL came out like so:

SELECT node.nid AS nid, node.title AS node_title  FROM node node   LEFT JOIN og_uid og_uid ON node.nid = og_uid.nid  WHERE (node.type IN ('campaign','setting','system')) AND node.nid NOT IN (select nid from og_uid where uid = 1);

It is said you can programmatically forward the results of such a query into the Views system for theming.

Maybe a special handling of the argument Organic Groups:Member of a Group, Exclude Argument option?

I also posted to d.o in hopes of pushing the issue conversation onward.

羁〃客ぐ 2024-08-14 00:24:02

荒野。 OG Views Extra 已在您首次修订此后的三天天内提供问题。我没用过,但看起来应该可以。

那么为什么要安装这个模块呢?如果您需要更细粒度的控制。这
可用的用户选项:

  • 不是群组成员
  • 群组成员或网站管理员
  • 仅限群组成员

Wild. OG Views Extra was made available on d.o three days after your first revision of this question. I haven't used it, but looks just like it may do it.

So why install this module? If you need finer-grained control. The
available user options:

  • Not a Group Member
  • Group Member or Site Admin
  • Group Member Only
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文