0

How do you add a comment form on your user profile in Drupal 7? I have installed panels but I don't know how you add the comment form on the users profile

0

4 Answers 4

1

I believe that the user profile is not a type of "node" so it is invisible to Panels. Therefore, you will most likely need to write a custom module that will inject the comment form into the user's profile page.

3
  • any other alternatives? cause I'm not a programmer
    – Ruriko
    Commented Jan 17, 2012 at 1:01
  • If I knew of a module that could do this, then I would tell you because I try to avoid writing my custom modules. There is another thread (drupal.stackexchange.com/questions/11526/…) that suggests using profile2 module, but I recently tried it (and submitted a critical bug) where disabling it brings down your entire site (white screen of death).
    – user785179
    Commented Jan 17, 2012 at 1:13
  • ok I'm using profile2 module. What I don't understand is how do you attach it to user profile in views?
    – Ruriko
    Commented Jan 17, 2012 at 1:21
1

I've created a "guestbook" type content type with a user reference to the user. That content type has comments enabled. Then using the prepopulate module I pass the username to the "node add" page which looks like this:

node/add/guestbook?edit[field_guestbook_userreference][und][0][uid]=USERNAME

Then use a view to display the guestbook nodes on a user profile with links to see the comments.

If you use the profile2 module (which turns user profiles into nodes) then you can probably just enable comments to get your "profile comments".

You might also want to checkout the guestbook module, there has been some recent development for the D7 dev version.

2
  • I don't see an option to enable comments in profile2 module. I went Home > Administration > Structure > Profile types
    – Ruriko
    Commented Jan 17, 2012 at 1:38
  • sorry, looks like that's not possible after all. I saw your questions in the profile2 issue queue, please update here if you get an answer.
    – uwe
    Commented Jan 17, 2012 at 2:27
0

Have a look at the Disqus module, which says that you can add comments either on node or to user:

Drupal Integration

  • Display recent comments, popular threads, and other widgets in blocks
  • Provide comments on any node type or user
  • Views 2/3 integration (number of comments)
  • Single Sign-On
0

This is a duplicate question, have a look at this post, I went for user profile comments module

EDIT: user profile comments works module works fine out of the box, but has a lot of 'missing features', not recognized by: panels, features, views, i18n, etc. if you don`t need those, go for it.

Inspired by @moto-Tribe answer I solved like this:

You'll need: (modules) views, panels, rules, entity reference and entity reference prepopulate.

1.- Make a contentype named:user_comments, remove body field. Comments will be node title (255 Maximum length). Add a entity reference field (field_user_reference_comments)

2.- Make a USER view (user_comments), add relationship to "entity reference". In contextual filter add : User Uid->provide a defauld value:user id from url.

3.- Inside view make 2 blocks (I did content panes) First block: add UID field, rewrite results: <a class="" href="/node/add/user-comments?field_user_reference_comments=[uid]">Add comment</a>; Second block: add content title field usig the relationship. add more relations and fiedls as needed.

4.-Add a new rule (import from here, make sure follow syntax explainded above): { "rules_redirect_on_add_a_user_comment" : { "LABEL" : "redirect on add a user comment", "PLUGIN" : "reaction rule", "OWNER" : "rules", "TAGS" : [ "user account" ], "REQUIRES" : [ "rules" ], "ON" : { "node_insert--user_comments" : { "bundle" : "user_comments" }, "node_update--user_comments" : { "bundle" : "user_comments" } }, "DO" : [ { "redirect" : { "url" : "users\/[node:field_user_reference_comments]" } } ] } }

5.- Enable from panels "user-view". Add user being viewd, add views FIRST BOLKC, add Second block.

6.- You are done, works perfect.

Not the answer you're looking for? Browse other questions tagged or ask your own question.