Hi all:
I'm planning to use OG in some sites I'm developing and have found that the audience selection can be improved.
* There are some problems related only to OG: For example see http://drupal.org/node/130601
Here we can talk about two things:
Do we need access to audience fields always?
Is not possible to give the admin the chance to restrict that?
If we do, how can be the nodes moved from a group to another? (this is the problem that caused SomebodySysop patch not to be committed)
And the audience has to be always a multiple select? -> That's about crossposting
I think that crossposting to more than one group is a valuable thing but it has to be used with caution.
A lot of admins wouldn't like to see some content types crossposted as this could cause, for example, that comments of one group to be seen in other groups! This can result in a lot of problems since users think their comments are only readed in their group, and they "know" the people in the group. Is very likely that they don't expect other people to read their comments.
The solution to the above is to have crossposting enabled on a content type basis. This way I can disable crosposting or story (the content type normal users use to write contents) and allow crossposting to, for example, page. The I disable comments on pages and I'm out of trouble.
This is only a example.
* And others problems are related to OG contrib modules: For example, http://drupal.org/node/156661
This last issue is common to all contrib modules that provide any kind of taxonomy managed containers (think in og_forums, og_galleries, og_vocab, og_book (I want to rewrite this since it seems to have dissappeared), etc.).
The problem here is that you can select a term (f.e. a forum) that belongs to a group and select as audience another group. This is very inconsistent and I think it makes this modules unusable in a lot of situations.
We need to provide a common and clear way for this kind of contrib modules to set the audience automatically in function of the selected forums, galleries, etc.
* So I've thinking and want to make a initial proposal as a starting point for a discussion about the best way to solve all this problems. I can help with some coding if we agree in the changes needed to be made. I would prefer to spend my time in improving the modules than in making ugly patches for my own use.
This is my proposal:
A) OG SETTINGS BY CONTENT TYPE:
- New configuration options by content type implemented in hook_form_alter for the node_type_form.
- All this data will be saved in the variables table, so no need for database mods here.
- Only applied to not omitted content types
* Crosspost allowed:
- True
- False
* Audience selection:
- Author/editor selected
- Module selected (or code driven)
* Audience required:
- True
- False
* Visibility:
- Always private
- Always public
- Author/editor select (defaults to private)
- Author/editor select (defaults to public)
B) OG GLOBAL SETTINGS:
- Remove the following settings under "Node authoring form":
- Audience checkboxes
- Visibility of posts
- Audience required
C) OG PERMISSIONS:
- New permission in hook_perm (By role)
* Manage content audience -> This will allow a user to view and change the audience of a node in any way (I think this can be improved... more fine grained? only allow to change group if no crosspost allowed?)
This permission(s) are only needed to allow changing a node to another group when no crosspost is allowed (this is a thing that moshe wants to be solved in order to restrict the audience selection form fields. See http://drupal.org/node/130601)
Perhaps SomebodySysop can help here? This will be very useful with his new module OG User Roles
D) NODE_FORM:
- Modify og_form_add_og_audience to show the audience form fields in function of the above settings for the *current content type* and *current user roles*. The detailed logic has to be discussed
- The audience form fields can be -> text (no selection available), checkbox list (crossposting allowed) or radio/select box (no crossposting)
E) NODEAPI:
- Modify the hook_nodeapi code to provide a hook to contrib modules that allows to set the audience (og_groups) in a clean way for the content types they manage. This hook will be called on insert and update.
- Modify the validate code to validate in function of the above settings...
Thanks.-
PD: Sorry if I've said any stupid thing... I have experience with PHP and drupal admin but not so much with drupal programing.
PD: Since this involves more than one module, I've filled an issue in og, og_forum and og_gallery to bring attention to this thread
Comments
keep going - more IA
thanks for thinking about this. node type specific settings make sense but we are struggling organizing the behavior today using just site-wide variables. specifically, we need to settle http://drupal.org/node/164070 and http://drupal.org/node/178811. so, we're just not ready yet for node type settings. for now, contrib modules can implement these.
i'd love to see a chart of the different combinations of settings+admin/nonadmin and what is expected of the audience field. consider the 'edit' case since thats more complicated. you might want to ignore crosspost variable for now just to stay sane.
imo, the challenge here is not code. i am having a hard time working out what he right behavior should be. once thats settled, code is easy.
unless i am mistaken, those contrib modules can already set $node->og_groups (and taxonomy) as needed using a combination of hook_form_alter and hook_nodeapi(submit). the form and nodeapi systems are very flexible.
You're right: It's better to
You're right: It's better to clarify the current audience behavior and then discuss about audience setting per group, role, content type or whatever else...
I've read the issues http://drupal.org/node/164070 and http://drupal.org/node/178811
I'll post here my thoughts about the audience and visibility settings (if you want me to post in the previous issues, please ask me to do it. I post here because I think this a more generic discussion)
Well, this are my thoughts for this week. What do you think?
PD: Sorry if something isn't clear enough. It's very difficult to me to express this subtle things in English.
more complicated
I am interested in the 'site-wide' checkbox as part of Audience. Have to think about that.
Alas, I think the system you setup is more complicated than today, not less. You call for a Public checkbox for each group, instead of a single one applying to the post as a whole. Thats too many decisions for the author. I know what you are going for, but I'm not so satisfied.
'site-wide' checkbox
I like that idea of a 'site-wide' checkbox. In addition to the advantage that Javier describes, this checkbox would also provide a mechanism for having content that is not public but available to all authenticated users, namely content with the site-wide audience checkbox checked but with the 'public' checkbox unchecked. I don't think this is currently possible, or is it?