2

I have a multi-user site. When a new user registers, several nodes (such as gallery node, etc.) are automatically created for him/her.

There is a panel page for each user that displays a profile of its owner. The panel is composed of various view panes.

Very much like in other community sites, a visitor to the profile page will be able to leave comments (text + pictures.)

To that effect, and hoping this is the right approach, I am trying to include in the panel a comment form. Comment forms are attached to their respective nodes so that comments left on John's panel page do not show on Jack's panel page. Comments will be displayed under the form in a view. The view is obviously universal and the same for all panel pages.

Now, on to the comment form. There is a node, specially for comments, created at the time the user registers.

How do I include the comment form of that node in a panel context knowing that it has to be different for each user?

I see that a node context can be passed into the panel. However, it requires a node ID. So that limits it to one node. Does it support some kind of token so that a different node ID loads on different users pages? If so, how would I write it?

If i am using the wrong approach on this, how should I go about it?

Any idea anyone?

Thank you. :)

1

I implemented a similar feature on my site: when a user registers, several nodes of different content types are created specifically for that user. I also use Panels.

To (somewhat) easily link the content with the user, I used the Relation module, which integrates with Rules. After I created the content upon account registration, I created relations between the user and the content (all using Rules-- if you do this, you'll need to make a rule set and create the content in one rule before creating the relations in a following rule; otherwise, you'll get some weird errors).

Then, without using Panels contexts, I simply created content panes in Views that pull in the content by adding relations (from the Relation module) as relationships (in the Views UI).

The challenge of this approach is that setting up rules to fetch the relations and loop through them is pretty complex. It might be easier to use the Entity Reference module, which has Rules integration, but when I was building my site a year ago it was broken so I used the more complex Relation module instead.

  • Wow... I would never have thought of this! I see i still have some work to do. Thank you for your time and advice. I will post the results here once I am done. Again, thank you. :) – user14666 Jul 11 '13 at 6:07
  • I tried everything. I followed the tutorial for the Entity Reference, created an Entity Reference field for the the user profile and added the referenced entity relationship to the view. As soon as I make the relationship required, regardless of the contextual filter, nothing shows. I tried this in the pane view and the (newly created) Entity Reference view. I also tried it in reverse, adding an Entity Reference field to the comment node and repeated the procedure, but nothing. – user14666 Jul 11 '13 at 19:15
  • How did you set the value of the Entity Reference field? Are you sure you set it correctly? – Patrick Kenny Jul 12 '13 at 0:41
  • On user account setting: Widget type: Select list, Default value: comment form. Target type: Node. Target bundle: Comments on profile pages. Mode: Simple No, I am not sure at all it is set up correctly. I guess if it were it would work! LOL :) I am trying all sorts of combinations/permutations but to no avail. – user14666 Jul 12 '13 at 5:34
  • I am trying to get the logic straight here. A) There is ONLY ONE node that will receive ALL the comments left by everyone to everyone across the site. Right? B) If so, then it is a matter of sorting who left a comment to whom. Now, in my available relationships I only have "author" as users. That means I can only set a contextual filter relating to the author, i.e., all the comments one user left across the site (and that works.) Now the trick is to filter those comments by recipients. Still correct? (continued below...) – user14666 Jul 12 '13 at 16:04
0

I have to use this because the site doesn't allow editing of comments for more than five minutes!

Anyway...

I tried everything. I followed the tutorial for the Entity Reference, created an Entity Reference field for the the user profile and added the referenced entity relationship to the view.

As soon as I make the relationship required, regardless of the contextual filter, nothing shows. I tried this in the pane view and the (newly created) Entity Reference view.

I also tried it in reverse, adding an Entity Reference field to the comment node and repeated the procedure, but nothing. Maybe it doesn't work because one is a node and the other a user? I have no idea. I am back to square one.

It's very discouraging. I am back to square one. Anyway, I really appreciate what you've tried to do. Thank you. :)

  • If you want to change a comment, you can delete it and add a new one. – Patrick Kenny Jul 12 '13 at 0:37
  • Ok. I hadn't seen the little cross to delete. Thanks for pointing that out. – user14666 Jul 12 '13 at 5:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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