Place a custom "Send a PM" link with Views, Panels

Last updated on
30 April 2025

Use case: I want to show a "Send a PM" link to a user, but I want to control the placement.

Possible solutions

Views

  1. Create a view of users and fields.
  2. Add a block.
  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 the advanced 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 in the Block UI wherever you want.

Panels

Follow the same instructions as for Views above but in step 2, add a content pane instead of a block.

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.

Author Pane

Privatemsg integrates with the Author Pane module. A "Send a PM" link will be shown in each user's author pane.

Help improve this page

Page status: Not set

You can: