Hi there,

I can't seem to figure this out:

On my site, a user of role A can submit an article (displayed using views), user of role B can upload images (with a modified comment). Now I want, below each article, a forum where one can discuss the article and the images.

How and where do I start??

Thanks for any response!
Grtz
Tommy

Comments

cameron tod’s picture

Assigned: Unassigned » cameron tod

It sounds like you need to enable Comment module, which is included with Drupal core.

I have set up a very basic example for you here, on my test site: http://camerontodtest.devcloud.acquia-sites.com/node/11

You can read documentation on how to work with it here: http://drupal.org/documentation/modules/comment

Is this the sort of thing you were looking for?

larowlan’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)
larowlan’s picture

Bumping priority
Please update status when you respond

tds2012’s picture

Status: Postponed (maintainer needs more info) » Active

No,

the comment module is already in use, modified so users can upload an image as comment to the article. These images are also used in a views block and are displayed below the article (with rating).

Forum module is enabled and I have a nice little forum in my user menu, but:
- I can add a new topic with regular textfield but when commenting on the topic, the form doesn't work (because of above)
- and, I don't want that menu-item, but a forum displayed below the article with the images, so users can discuss the articles and the images. Each new article has to have a forum.

Removing that menu-item is no problem, the article with the images (comments) displays fine, but how to get that forum?

cameron tod’s picture

Status: Active » Postponed (maintainer needs more info)

I'm not sure that a forum displayed inline is the ideal solution for this use case. For on page discussion, comments are ideally suited and very flexible. They are fieldable entities, so you can add whatever data you wish to each comment, and they support threading natively. For example, some of your comments could include images, and comments could follow underneath those without images.

If you want to go down the path of embedding a forum below each node, you will probably need to implement this functionality in a custom module. I haven't been able to find a suitable contrib module after some googling. Even then, it may not work well - for example, you may have to redirect users to a new page to post replies, and manage the redirect back to your original node, amongst several other considerations.

Bear in mind I am not an expert on the forum module. I have cobbled together the below by browsing the API docs.

The steps that you could take are:

- Whenever a new node of type 'Article' is saved (use hook_node_save() here);
- Create a new forum using forum_form_submit(), populating the $form_state as appropriate to save a new forum.
- When a node is displayed, use hook_node_view() to call forum_page(), embedding its output in $node->content. You will need to design a mapping system mapping forum term ids to node ids.

Let me know how you get on.

tds2012’s picture

Status: Postponed (maintainer needs more info) » Active

This is more of an answer that I can handle! This is my first drupal site and I'm in the first stage of learning php. To an extent, I can follow your answer a bit but can't implement it, for the time being... maybe I can tell you in the near future if it works ;) .

Could the Reply Module be an answer?
The reason I use the comment module for images is that I can close uploading images after some time span (Comment Closer module) and have Fivestar Rating module below each image. After closing, users should still be able to discuss.

Maybe, my approach is wrong? Is this setup possible with View Module? User role A submits article via a form (content-type, only user role A can submit article). A View displays all the articles in a table (I also have other uses with View). On clicking the title, one is directed to the full article (like it is now) and there, thus with View?, user role B can submit images during some time span (only user role B can submit)(user role A, author of the article, should be able to rate).

So, in that case, I can use the normal comment module (with submit permissions for user role A and B).

cameron tod’s picture

Status: Active » Postponed (maintainer needs more info)

So, your use case is:

1. A new "Article" node is created
2. Users may upload images related to the "Article".
2a. Users may rate each image.
2b. Users may comment on each image.
3. After time x, users may not upload any more images, but can continue to comment on each image.

Is that right?

If you want to continue using comments, you may look at using Rules. You could create a rule along the lines of

IF this is an "Article" node AND user posts a comment AND time_now > (time "Article" was posted AND $specified_time_period) AND comment contains image THEN do not create the comment and display an error message.

The other approach you could take is using some combination of Panels and Entity Reference to create images as individual nodes, instead of comments, which are linked to the parent "Article". Panels (I think) has options to embed node forms anywhere - so you could use it to have a node form below the "Article".

Hopefully this hasn't confused you too much! They are just a few ideas that come to mind. Good luck!

tds2012’s picture

Status: Postponed (maintainer needs more info) » Active

Hello cam8001, many thanks for your fine response! I'll look into this and give it a try.

Use case more in detail:

1. A new "Article" node is created by user role A
2. Users of user role B may upload images related to the "Article".
2a. Users may rate each image. --> only user of role A can rate the images uploaded to their own article
2b. Users (both A and B) may comment on each image. hmm, yes, but not necessarily for each image, rather a general discussion
3. After time x, users may not upload any more images, but can continue to comment on each image. correct, but I want the comment system displayed below the grouping of images

Your suggestion, using Rules, still using Comments:

  • IF this is an "Article" node AND user posts a comment AND time_now > (time "Article" was posted AND $specified_time_period) AND comment contains image THEN do not create the comment and display an error message.

Textual comments and images are displayed chronologically, some images, a text comment, then again image and so on? In the user's View, in his personal menu, all images of that one user of role B, images as well as text comments will be displayed? That would not be very desirable.

The other approach looks interesting though, displaying each image as node! I guess, display would be like this then:

* article
* node form for uploading image (with Rules for the time period??)
* display of all "image nodes"
* comment form
* comments to the article

dcam’s picture

Issue summary: View changes
Status: Active » Fixed

It looks like this was answered. Feel free to reopen the issue if you're still having problems.

dcam’s picture

Status: Fixed » Closed (fixed)