有机组 - 允许创建的节点类型
想知道是否有人可以阐明 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
OG 的核心行为是每个内容类型都定义它自己与 OG 的关系。他们可能被禁止加入群组关系、群组节点或群组帖子。该基本配置中没有任何内容可以单独指定内容类型和每个组类型之间的关系。
然而,您可以采取一些技巧来尝试促进某些事情。
廉价的技巧
例如,如果您隐藏导航来创建给定内容类型的节点,那么您就切断了显而易见的方法。
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.
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.
当您创建“鞋子/食物”节点时,有一个下拉/选择列表可以选择将其添加到的组,对吧?
应该可以编写一个实现 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