tips and tricks for movable type

automated mailto link for an author
November 06, 2002

You probably have a contact link somewhere on your page which allows people to send you mail. Instead of hard-coding the email address, you can use this code:

<MTEntries lastn="1" author="girlie">
<a href="mailto:<MTEntryAuthorEmail spam_protect="1">">send me mail</a>
</MTEntries>

(Of course, change girlie to your author name.)

The advantage to this method is that, if you ever want to change your email address, you can do so in one place (your Author Profile), rebuild all your pages, and every instance of your email contact link will be updated without your having to do it manually per template. Plus, you get the benefit of the spam_protect attribute.

Comments

That is a good tip.

I was wondering the other day about a somewhat related problem: if there is a way to make an email address used in a post or comment "spam_protected". Maybe with one of Brad's notorious plugins, but still have not figured out howto.

Could maybe use the macro feature and auto link any word with an '@' in it as "href=mailto:...".

Have you seen this question before? Maybe on the forum?

by Quadsk8 | 11.07.02 04:39 AM

I know who to ask :-) ...
Thanks girlie!

Lawrence

by Quadsk8 | 11.09.02 05:25 AM

Girlie,

I am using your tip <MTEntries lastn="1" author="girlie"> now also in my RSS feeds, since I have a second author on my Blog now.

BTW I made a MT template for Comments in RSS 2.0 style which http://www.groovycompany.nl/Events/comments.xml" rel="nofollow">validates, if anyone is interested...

Lawrence

by Quadsk8 | 11.10.02 03:38 PM

Hi, I have a question I'm hoping you can help me with. I want to add a link like the one you have here for email that will show up only when comments are turned off. Any help or suggestions you may have would be greatly appreciated!

by Lee | 05.20.03 09:22 PM

I would like to have a Contact Form like this one but it shouldn't be part of the comment-feed for an entry.

Does MT have a cgi script already setup to use such a form?

Thanks
Neil

by Neil Dewkinandan | 07.03.04 08:08 PM

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

TrackBack: 1
(URL: http://www.thegirliematters.com/sf/mt-track.cgi/111)

» Enhancing the Blog Installation
Excerpt: If I ever had time, I could install a number of plugins for Movable Type: search, related entries, word count.
Weblog: Emmanuel's Professional Blog
Tracked: 11.22.02 12:44 AM