A Simple Plug-In: NicknameLink

As you've already seen, Movable Type provides the template tag MTEntryAuthorLink for inserting a linked version of the username of an entry's author. However, it doesn't include an equivalent tag if you want to use the author's nickname instead. In that case, the best you can do is fake it by inserting the markup to create the link yourself:

<a href="<$MTEntryAuthorURL$>"><$MTEntryAuthorNickname$></a>

But that's a poor substitute, since it will create an empty link if the author hasn't entered a URL into his or her profile. If you wanted to emulate the MTEntryAuthorLink tag's ability to fall back to creating a mailto link with the author's email address if the URL isn't available, or to simply insert the author's ...

Get Sams Teach Yourself Movable Type in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.