This topic is locked
[SOLVED]

 Hiding email when using email hyperlink

9/19/2015 2:09:13 PM
PHPRunner General questions
T
tparki authorDevClub member

I want my members to be able to email each other but don't particularly want them to see a screen full of emails. Thus I want to display 'Email this person' instead of the actual email of that person on the List and View pages. Any ideas?

Thanks

Tim

Sergey Kornilov admin 9/22/2015

If you use 'View as' Custom for email field you can do something like this:

$value = '<a href="mailto:'.$value.'">Email this person</a>';
T
tparki authorDevClub member 9/23/2015

That works just fine, Sergey. Thanks

The recursive use of $value is interesting but I can't work how to to replace the text Email this person with the field Firstname?



If you use 'View as' Custom for email field you can do something like this:

$value = '<a href="mailto:'.$value.'">Email this person</a>';


Sergey Kornilov admin 9/23/2015

Sure, this can be done. See this article that explains how you can access value of any field from the same record:

http://xlinesoft.com/phprunner/docs/_view_as__settings_custom.htm