This topic is locked

Replace e-mail link with picture

6/9/2008 11:16:31 AM
PHPRunner General questions
M
mmponline author

I have an E-mail field with E-mail Hyperlink setup in view properties. It thus opens the send new message window.
I need to replace the e-mail address to display a picture (named emailbutton.jpg) but on click still opens the "new message" box.
Furthermore I'd like the Subject to display something like:
Request from website - (Then the company name - Fiedname:Company - of the specific listing).
Secondly:

I also need to replace a Website link with a picture.

M
mmponline author 6/10/2008

Any help on this?

J
Jane 6/10/2008

Hi,
use custom format on the "View as" settings dialog on the Visual Editor tab for this purpose.

Here is a sample:

$value = "<a href=\"mailto:".$value."\">".$value."</a>";

M
mmponline author 6/10/2008

I don't get this.

I have an email field containing the email addresses of each client. Instead of showing the e-mail address, I need it to show a picture (emailbutton.jpg) and when clicking the button it should open the "new mail page".

J
Jane 6/10/2008

Stephan,
just replace $value with your image:

$value = "<a href=\"mailto:".$value."\"><img src=\"image.gif\"></a>";


Here are some helpful links:

http://www.w3schools.com/html/html_links.asp

http://www.utoronto.ca/webdocs/HTMLdocs/Ne...url_mailto.html

M
mmponline author 6/17/2008

Jane

  1. How do I replace the website hyperlink with a picture as well. The web address is saved in a field and I've selected the Hyperlink (show as text) Visit our website. I now need to display a picture in the place of the hyperlink.
    If I change the path of the code supplied I can get the picture to show, but the hyperlink is wrong:

$value = "<a href=".$value."\"><img src=\"website.jpg\"></a>";


2. The pictures also have a purple block around it as it is a link. How do I prevent it from showing.

See link

M
mmponline author 6/17/2008

I got the website link to show with the following code in properties - custom:

$value = "<a href=".$value."><img src=\"website.jpg\"></a>";


I want the picture not to display when the field is empty. I've tried using the code:

{if $show_FieldName}

<TR><TD class=shade>FieldName</TD>

...

</TR>

{/if}


But this does not work in conjunction with above code...

M
mmponline author 6/17/2008

Got the block soreted out: border=0
I still can't get it to hide the picture when the e-mail or website field is empty...

J
Jane 6/17/2008

Stephan,
here is a sample:

if ($value)

$value = "<a href=\"".$value."\"><img src=\"website.jpg\" border=0></a>";

M
mmponline author 6/17/2008

Works 100%, Thanks Jane.