有机组 - 允许创建的节点类型

发布于 2024-09-18 05:18:36 字数 238 浏览 7 评论 0原文

想知道是否有人可以阐明 Drupal 中的 OG 组。

我知道您可以限制可以在组内创建的节点类型,但是如果您有两种类型的组怎么办?您可以将某种类型的节点的创建限制为仅限一组吗?

例子: 我允许用户创建名为 Sports 的组 我允许用户创建名为电影的组

我有两种类型的节点:食物和食物。鞋 我可以设置食物节点只能在电影组内创建吗 并设置“Shoes”节点只能在“Sports”组内创建?

谢谢 :)

Wondered if someone can shed some light on OG groups in Drupal.

I know you can restrict what types of NODES that can be created within groups, but what if yuo have two types of groups. Can you restrict the creation of a certain type of node to only one group ?

Example:
I allow users to create groups called Sports
I allow uses to create groups called Movies

I have two types of nodes: Food & Shoes
Can I set that the Food node, can only be created inside the movie group
And set that the Shoes node can only be created inside the Sports group ?

thanks :)

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

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

发布评论

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

评论(2

OG 的核心行为是每个内容类型都定义它自己与 OG 的关系。他们可能被禁止加入群组关系、群组节点或群组帖子。该基本配置中没有任何内容可以单独指定内容类型和每个组类型之间的关系。

然而,您可以采取一些技巧来尝试促进某些事情。

廉价的技巧

例如,如果您隐藏导航来创建给定内容类型的节点,那么您就切断了显而易见的方法。

OG 用户角色

我能想到的最传统的技巧可能是在权限级别上划分不同的内容类型。我并不完全肯定这会起作用,因此需要进行一些实验。

  1. 创建一个体育作家角色,限制其创建和编辑篮球节点的能力。
  2. 使用OG 用户角色自动将体育组类型的成员提升为体育作家角色。

尖端恶作剧

您还可以使用 Spaces 模块通过 功能。事实上,spaces_menu_alter() 的实现可能会向您展示如何以编程方式构建您正在寻找的功能。听起来好像很有用。

Core behavior of OG is that every Content type defines it's own relationship to OG. They might be barred from a group relationship, a group node, or a group post. There is nothing in that base configuration to specify the relationship between a content type and each group type individually.

However, there are a few tricks you could put in place to try to facilitate something.

Cheap Trick

For example, if you hide the navigation to create a node of a given content type, you've cut off the obvious approach.

OG User Roles

Probably the most conventional trick I can think of would be to carve up the different content types on a permissions level. I'm not entirely positive this will work, so it will bear some experimentation.

  1. Create a Sports Writer role, limit the ability to create and edit Basketball nodes to it.
  2. Use OG User Role to automatically promote members of the Sports group types into the Sports Writer role.

Cutting Edge Shenanigans

You can also use the Spaces module to toggle content type availability by Feature. In fact, the implementation of spaces_menu_alter() might show you how you could programmatically build out the functionality you are looking for. Sounds like it would be useful.

写下不归期 2024-09-25 05:18:36

当您创建“鞋子/食物”节点时,有一个下拉/选择列表可以选择将其添加到的组,对吧?

应该可以编写一个实现 hook_form_alter 的模块来拦截食物和鞋子节点的节点形式,并根据节点类型进行查找以过滤可用的组。

编辑这个模块似乎存在,它可能会满足您的要求:http://drupal .org/project/og_content_type_admin

When you create a Shoe/Food node, there is a dropdown/select list to choose the group it gets added to, right?

It should be possible to write a module that implemented hook_form_alter to intercept the node form for the food and shoes node and do a lookup based on the node type to filter the groups made available to it.

edit This module seems to exist, it may do what you require: http://drupal.org/project/og_content_type_admin

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