Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi, I can see the comments after clicking on "View" on the Account Page, but how I can let Drupal show also the Comments on my normal Account Page? I tried so much out, please help me!
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedHi, so far I found out this has to be programmed. First I thought my programming skills are not enough, but now I am working on a module that is exactly doing that.
Comment #2
Passionate_Lass CreditAttribution: Passionate_Lass commentedHi marenz. I was wondering if your module has been completed...
Comment #3
zilla CreditAttribution: zilla commentedyou can not show the comments unless the profile is set to full content AND takes over the profile, apparently...it's a bit odd in terms of user experience, but perhaps this should go in as a feature request...?
Comment #4
halfiranian CreditAttribution: halfiranian commentedAny more info on this one? I've got the same problem.
Comment #5
savioret CreditAttribution: savioret commentedI have the same problem... :-(
Maybe the best option is to set the Don't display this content profile on the user account page option and use your own profile template and call directly to
comment_render($nid, $cid=0)
to show de comments.Anyway the problem persists if you access the node using ?q=node/XX (sometimes the VIEW link still points there...)
This module seems too problematic I think I'll try the guestbook module instead.
*UPDATE*
Well, after trying Guestbook, maybe the best integrated option is Content Profile... so I'll try to make my own profile template...
I still don't know what to do to avoid the ?q=node/XX link....
Comment #6
halfiranian CreditAttribution: halfiranian commentedI basically created a block 'view' of my comments, embedded that, and then called the comment form.
I put this in my node-profile.tpl.php page:
Comment #7
savioret CreditAttribution: savioret commentedI have found this documentation in the author's blog.
Theming with content profile
When you have a "profile-as-nodes" you probably want to use some profile information stored in your profile content in some of your themes, e.g. to show some additional information about the author of a forum post. To do so, you previously had to manually load the profile node in your theme and output the right data at the right place - yeah and not forget to properly check your data...
This cried for improvements, so I tackled this problem. We need to be able to easily access the data of the created profiles, where it should be already properly prepared for use in a template so you haven't to check it yourself. Yes and we should do that fast.. So just loading all profile data and putting it into $user is really no option.
The solution I came up with is $content_profile: A little nice variable which is available in templates related to users that let's you access all the information stored in profiles. The nice thing is that it offers you all variables you are used to have a in a "node template" and it lazy-loads the profile content nodes - so they aren't loaded for nothing.
This is an example use you could put in a template to show the profile content's title:
echo $content_profile->get_variable('profile', 'title');
For more, check out the README.txt which ships with the module.
Comment #8
halfiranian CreditAttribution: halfiranian commentedBut that has nothing to do with showing comments, does it?
Comment #9
savioret CreditAttribution: savioret commentedYes it has. For example, here is my solution:
Hope it helps.
Comment #10
twopointoh CreditAttribution: twopointoh commented#9 - I cant get that working! Can you advise what I might be doing wrong? I followed your instructions - but no comments are printed or ability to add comments. I am so confused. I am using Drupal 6.x.
The only part I couldn't see where to go to was "Set Don't display this content profile on the user account page from admin options." Where is this?
Comment #11
savioret CreditAttribution: savioret commentedI assume you are using content profile module
You should see this option in admin/content/node-type/%type%/profile
Comment #12
Sailingdude CreditAttribution: Sailingdude commentedBirwil, do you mean: "Use this content type as a content profile for users"? I followed your steps, but i get this error:
warning: Invalid argument supplied for foreach() in /usr/home/deb23581/domains/dezeil.nl/public_html/drupal/sites/all/modules/cck/content.module on line 1284.
Comment #13
savioret CreditAttribution: savioret commentedsorry I'm not using CCK... :-(
Comment #14
51ucars CreditAttribution: 51ucars commentedit works for the core comment module. any suggestion for node comment showing in the content profile?
I try to embed view of node comment view -defaults using veiw_get_view and print, but doesnot work.
Comment #15
charlybrown CreditAttribution: charlybrown commentedI have been looking for something like this for some time now. Does the module you were creating functioning?
Regards,
chi hair straightener
Comment #16
heather CreditAttribution: heather commentedTo show comments on the profile page.
Step 1: Edit the Profile content type:
- Enable comments, and set whatever settings you like. I like my comments 'Flat' and to hide subject lines.
- Select: Use this content type as a content profile for users
- Save
Step 2: Override the theme template file.
- Locate the content-profile-display-view.tpl.php in the Content profile module directory. Copy this into your theme directory.
- Open your theme's copy of content-profile-display-view.tpl.php. Add this code to the bottom:
- Clear your theme registry
This puts the comments on your profile page. Just tried this yesterday!
Comment #17
Rick Hood CreditAttribution: Rick Hood commentedConfirming that Heather's solution work's great. Thanks Heather.
I am working on a site where I need to create a Facebook style (sort of) "wall" -- trying to do just using Drupal core commenting (to keep things simple) -- comments on user profiles more or less does that.
I also used the suggestion here: http://drupal.org/node/661572#comment-2411118 so that when hitting the profile node directly it redirects you to the user page. Without that, if you post a comment to a profile in a user page, it redirects you to the profile node, when really you want to come back to the user page.
I wanted the user page to be a users "home page" (not the profile node) because that is the page that is linked to from so many places (such as 'author' link on posts).
Comment #18
Q2U CreditAttribution: Q2U commentedsubscribe
Comment #19
mpavankumar CreditAttribution: mpavankumar commentedhi Rick, did you find the solution for staying on the page after submitting the comment?
Comment #21
Heihachi88 CreditAttribution: Heihachi88 commentedsubscribing either
Comment #22
Heihachi88 CreditAttribution: Heihachi88 commentedin node-profile.tpl.php add these lines of code: