Gossamer Forum
Home : Products : Links 2.0 : Customization :

using email addr as link

Quote Reply
using email addr as link
We have a site that includes the possiblity of adding employment opportunities and I have modified my setup (links.def) so a user can use an email address as the link (some of our users do not have http pages). This all works quite well except when I click on a link that uses an email address, I get a blank page and then a window from my default email client (OE) so I can write the owner of the link a message. The problem is the blank page since I have had reports from some users who only get the blank page. I assume that is because they have not specified a default email client.

What I would like to do is to generate on the fly (if possible) or via nph-build a page with a message to the effect that this is an email only link and that the reader should open their email client to write to the link owner.

I haven't found any way of doing this. Is it possible?

TIA

Bob
Quote Reply
Re: using email addr as link In reply to
My suggestion is that you do not use the URL field for the email address, simply use the Contact Email field as the email link, like the following:

Code:
<%if URL%>
<a href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>"><%Title%></a>
<%endif%>

AND

Code:
<%ifnot URL%>
<a href="mailto:<%Contact Email%>"><%Contact Name%></a>
<%endif%>

You can also turn of the required attribute for the URL by changing the field to 1 to 0 in the required attribute space.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------








Quote Reply
Re: using email addr as link In reply to
Thanks Elliot. I had thought of turning off required for the URL field, but then I have the problem that people can submit links that are not links - if you get what I mean. I should mention that our readers seem to be on average web users since last Christmass - ie _real_ newbies. For example I have to explain what a link is, event what a listing on the site is (yuk). Sorry, that was all OT.

I like your idea of just using the email address though, but I need to do the checking. I was wondering if maybe I could just have them enter "email" in the URL and then set the validation criterium in links.def to '^http|email' to force one or the other. What do you think?

If I understand correctly I could then use something like

<%if URL eq "email"%>blah blah<%endif%>

and

<%ifnot URL eq "email"%>my standard links jump<%endif%>

Seems like that ought to work. Or am I missing something?

THX
Bob
Quote Reply
Re: using email addr as link In reply to
That will not work. "email" will not be a value in your URL field. "mailto" is a valid expression, yet not a value.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------