Community Documentation

How to use Private Message with Panels (and Views)

Last updated January 1, 2013. Created by iandickson on January 1, 2013.
Log in to edit this page.

It took me hours to find this so I copied it here for the benefit of others. If I ever meet ptmkenny I'll buy him a drink :-) Another member noted that Author Pane would work, but I didn't want yet another module...

Posted by ptmkenny on March 29, 2012 at 6:14am

I am overriding my users' profile pages with Panels. I made a "Send a PM to this user" link using Views.

Here's what I did:
1. Create a view of users and fields.
2. Add a content pane.
3. Set "User: Uid" as the contextual filter. "Hide view" when the filter is not available. When the filter is available "Specify validation criteria" to be "User" and "only allow numeric UIDs."
4. Under pane settings, set argument input to "From context" and require the "User ID" from under User.
5. Under fields, remove the user name and add a "Privatemsg: Send privatemsg link" field.
6. Save the view.

You can now add this as a pane in Panels and it will give you a single link to place wherever you want. If you don't want to show the link on a user's own profile, you can adjust the visibility settings (in panels) to not show the link when the logged in user = viewed user.

About this page

Drupal version
Drupal 7.x
Audience
Site builders

Site Building Guide

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.