0

I crated a view to show a list of registered users such as as name, email, job etc. one of the fields I am also listing is a private link so other members of the site would be able to contact that user. Authenticated users can see the link and send a private message, but what I would like to to is to allow anonymous users to see the private message link but when they click on it they should be redirect to the login form. Is there a way to do that? I´ve been googling around and can´t find an answer.

I would really appreciate if you can help me to find a way to to this.

Thanks in advance

1

This might be what you are looking for (https://drupal.org/node/1988848)

  • Hi Geoff,Thank you very much for your answer, that actually works pretty good. I am just missing something, I would like anonymous users to log in first and then send a message. The patch provided on the link allows anonymous users to write directly to register users without login or registering first. Is there a way I can add that feature to my views list? Thanks in advance – gjanet83 Jun 6 '14 at 15:01
  • Oops, I think I misread your question, sorry - try creating a NO RESULTS BEHAVIOUR for the field with the link - add a link to your login page (user/login) – Geoff Jun 6 '14 at 16:17
  • Hi Geoff, thanks for your comment. Unfortunately the privatemsg field link does not have the NO RESULTS BEHAVIOR option... I think I should try to create another link field, add it to views and see if I get that.. – gjanet83 Jun 6 '14 at 16:49
  • are you using Privatemsg Views to integrate the link? – Geoff Jun 6 '14 at 17:36
  • 1
    Ok... this should work - in the view, create a field for UserID - make it hidden. Create a field Global Custom Text. Add whatever text you want (Message User) - Rewrite Results as a link - messages/new/[uid] . This should appear to all users, but assuming you have your permissions set, an access denied will appear if Anonymous users click. You can use settings or any number of other modules to force Access Denied attempts to be redirected to a login. – Geoff Jun 7 '14 at 4:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.