Hi,
Is there a way, or is it possible to have the link "Send a PM to this user" when using panel to do a the formating of the users profil page. When I activate the page user/% in pages the link is remove and there is no way to make it show and i do not know how to make the link appear. Is it possible to have a block whis this link only ?

Thanks !

Comments

RaulMuroc’s picture

Version: 7.x-1.2 » 7.x-2.x-dev

7.x-2.x-dev is still not possible so I change to this version.

Same problem for me, tried different workarounds: custom block, etc but no-one worked.

We could all help to port to D7: http://drupal.org/sandbox/dereine/1109340 which is referenced by issue: http://drupal.org/node/1123430

There we could include this functionality: A Block for link "Send a Personal Message to this user".

Thanks in advance.

Simon Georges’s picture

I just closed #1419962: Private Message Form in Panels Page as a duplicate of this one.

Simon Georges’s picture

I just closed #1123430: Privatemsg as block (for panels etc) as a duplicate of this one.

andypost’s picture

Also there's a project to replace this functionality - http://drupal.org/project/pm_existing_pages

ptmkenny’s picture

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.

Stado’s picture

Great!

Thanks a lot! I had wasted quite some time on this until I came across your post.
This is just perfect.
tnx

rogical’s picture

Author pane is able to display in panels which have pm inside.

ptmkenny’s picture

Category: feature » support
Status: Active » Closed (fixed)
jessehs’s picture

Here's an exported view designed to be embedded as a VIew Pane in a Panels page. It generates a link "Message [name]." It accepts the first argument of the panel, so it works when you're at /user/%user. It's hidden when you're at your own user profile page. (Don't import the opening or closing PHP tags.)

<?php
$view = new view();
$view->name = 'send_user_privatemsg';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'users';
$view->human_name = 'Send User A Message';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['access']['perm'] = 'access user profiles';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Field: User: Name */
$handler->display->display_options['fields']['name']['id'] = 'name';
$handler->display->display_options['fields']['name']['table'] = 'users';
$handler->display->display_options['fields']['name']['field'] = 'name';
$handler->display->display_options['fields']['name']['label'] = '';
$handler->display->display_options['fields']['name']['exclude'] = TRUE;
$handler->display->display_options['fields']['name']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['name']['alter']['ellipsis'] = FALSE;
$handler->display->display_options['fields']['name']['element_label_colon'] = FALSE;
/* Field: Privatemsg: Send Privatemsg link */
$handler->display->display_options['fields']['privatemsg_link']['id'] = 'privatemsg_link';
$handler->display->display_options['fields']['privatemsg_link']['table'] = 'users';
$handler->display->display_options['fields']['privatemsg_link']['field'] = 'privatemsg_link';
$handler->display->display_options['fields']['privatemsg_link']['label'] = '';
$handler->display->display_options['fields']['privatemsg_link']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['privatemsg_link']['text'] = 'Message [name]';
$handler->display->display_options['fields']['privatemsg_link']['return'] = 1;
/* Sort criterion: User: Created date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'users';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Contextual filter: User: Uid */
$handler->display->display_options['arguments']['uid']['id'] = 'uid';
$handler->display->display_options['arguments']['uid']['table'] = 'users';
$handler->display->display_options['arguments']['uid']['field'] = 'uid';
$handler->display->display_options['arguments']['uid']['default_action'] = 'not found';
$handler->display->display_options['arguments']['uid']['default_argument_type'] = 'fixed';
$handler->display->display_options['arguments']['uid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['uid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['uid']['summary_options']['items_per_page'] = '25';
/* Filter criterion: User: Active */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'users';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = '1';
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;

/* Display: Content pane */
$handler = $view->new_display('panel_pane', 'Content pane', 'send_user_privatemsg_panel');
$handler->display->display_options['argument_input'] = array(
  'uid' => array(
    'type' => 'panel',
    'context' => 'entity:comment.author',
    'context_optional' => 0,
    'panel' => '0',
    'fixed' => '',
    'label' => 'User: Uid',
  ),
);
$handler->display->display_options['inherit_panels_path'] = '1';
?>
sayansk’s picture

Where to insert this code?