New Podcast

Posted Tuesday, July 27 at 2:29 pm

Ryan Price and Mike Anello recently talked with Jacob Redding (jredding), author of Beginning Drupal as well Treasurer and Interim General Manager of the Drupal Association.

Download Podcast 41
DrupalEasy_ep41_20100727.mp3
Syndicate content

NEWSLETTER

Stay informed on our latest news!

Syndicate content

Testimonial

Spending the day with you guys really helped me realize that Drupal allows me to do many of the same things I manually did, but in a nice little package already to go. I look forward to attending the next class you have.

Who are we?

DrupalEasy is the collective expertise of Ryan Price and Michael Anello, who joined forces to provide training and consulting services worldwide. Read all about them and what they can do.

What is Drupal?

Drupal is a free, super-powerful content management system for sites that require information posting and collection, including blogs, forums, videos, photos, and databases of information. We think it is the best platform available. Here's why...

Why Drupal?

More and more savvy organizations are going with Drupal for content management, and its no mystery why. It’s free, flexible, and easy to maintain for small or large volume sites. Learn more...

Showcase a User's Comments with Views and Menu Tabs

By now, you should know and love the Tracker module that comes with core. It has its strengths, but many weaknesses. For one, you can't separate out posts from comments, or sort the list in interesting ways. Views can help you make exactly the list you want, and place it in a tab on the user's profile exactly like the "Track" tab.

For this example, you'll be adding a list of comments. Creating the view is simple enough:

  1. Clone the default view comments_recent, and call it comments_by_user
  2. On the Page display, add a Relationship for Comment:User
  3. Add an Argument for User: UID and choose Relationship: User (assuming you did not re-name the realtionship)
  4. Before saving the Argument, set the Action to take if argument is not present to be "Provide default argument", then choose "User ID from URL"
  5. Change the page's Path to "user/%/comments"
  6. Give the page a Menu entry by clicking the text that says "No Menu" and choose "Menu Tab", then name the tab "Comments"
  7. Make sure you save the view
  8. Visit any user's page, and you should now see a "Comments" tab next to "View"

For more information about creating views with Relationships, read Mike's article.

Trackback URL for this post:

http://drupaleasy.com/trackback/213
No votes yet

1 comment

Guest wrote 45 weeks 6 days ago

Thanks

I was just boggled trying to find the UID argument on a comment view and turned to Google, which brought me here. Working great, now, thanks. :)

Michelle

Syndicate content