How To Prevent Link-Rot in Movable Type or How To Easily Link To An Entry

First, grab copies of the MTMacros and Entry plugins, and install them on your site.

Next, create the following macro:

<MTMacroDefine name="entry_link" ctag="entry_link">
<a href="
<MTEntry id="[MTMacroAttr name='id']"><MTEntryPermalink></MTEntry>">
<MTMacroContent></a>
</MTMacroDefine>

When setup to be included in your entries, this macro will allow you to use the created <entry_link> tag to link to another entry on your site. If you change the structure of your site, the entry only needs to be rebuilt and the links will point to the new archive location.

You can use it in your entries like so:

<entry_link id="125">This</entry_link> is a link to the entry with the id of 125.

18 TrackBacks

David Raynes: How To Prevent Link-Rot in Movable Type or How To Easily Link To An Entry (uses Entry and... Read More

David Raynes: How To Prevent Link-Rot in Movable Type or How To Easily Link To An Entry Read More

Link Rot from Radio Free Blogistan on November 7, 2003 1:20 AM

Periodically web sites die, or get mis-published to the wrong server, or their content is simply reconfigured or placed behind a pay to play barrier. Link rot is a big problem for bloggers. David Raynes has a great little tutorial for preventing intern... Read More

Link Rot from Radio Free Blogistan on November 7, 2003 1:23 AM

Periodically web sites die, or get mis-published to the wrong server, or their content is simply reconfigured or placed behind a pay to play barrier. Link rot is a big problem for bloggers. David Raynes has a great little tutorial for preventing intern... Read More

Link Rot from Radio Free Blogistan on November 7, 2003 1:24 AM

Periodically web sites die, or get mis-published to the wrong server, or their content is simply reconfigured or placed behind a pay to play barrier. Link rot is a big problem for bloggers. David Raynes has a great little tutorial for preventing intern... Read More

Link Rot from Radio Free Blogistan on November 7, 2003 1:37 AM

Periodically web sites die, or get mis-published to the wrong server, or their content is simply reconfigured or placed behind a pay to play barrier. Link rot is a big problem for bloggers.... Read More

Link Rot from Radio Free Blogistan on November 7, 2003 1:39 AM

Periodically web sites die, or get mis-published to the wrong server, or their content is simply reconfigured or placed behind a pay to play barrier. Link rot is a big problem for bloggers.... Read More

Link Rot from Radio Free Blogistan on November 7, 2003 1:51 AM

Periodically web sites die, get mis-published to the wrong server, their content simply reconfigured, mis-templated, or placed behind a pay to play barrier. Link rot is a big problem for bloggers.... Read More

Link Rot from Radio Free Blogistan on November 7, 2003 3:15 AM

Periodically web sites die, get mis-published to the wrong server, their content simply reconfigured, mis-templated, or placed behind a pay to play barrier. Link rot is a big problem for bloggers.... Read More

Link Rot from Radio Free Blogistan on November 8, 2003 2:20 AM

Periodically web sites die, get mis-published to the wrong server, their content simply reconfigured, mis-templated, or placed behind a pay to play barrier. Link rot is a big problem for bloggers. David Raynes has a great little tutorial for preventing... Read More

I’ve learned a lot about Movable Type over the last couple of years. I’m comfortable working with the tags used by the system to create content display. My recent experience with some database problems, either caused by ecto or by... Read More

Future Proofing Entries from the epitome of ambiguity on February 19, 2005 11:41 PM

This is a link to this very post. Odd you may say, but I don't think so. I've been trying to track down something like this for a while now. So when/if I change archives links to particular posts will... Read More

Future Proofing Entries from the epitome of ambiguity on February 20, 2005 12:04 AM

This is a link to this very post. Odd you may say, but I don't think so. I've been trying to track down something like this for a while now. So when/if I change archives links to particular posts will... Read More

Future Proofing Entries from the epitome of ambiguity on February 20, 2005 12:04 AM

Odd you may say, but I don't think so. I've been trying to track down something like this for a while now. So when/if I change archives links to particular posts will be flexible and change as well. Used following... Read More

Future Proofing Entries from the epitome of ambiguity on February 20, 2005 12:08 AM

Odd you may say, but I don't think so. I've been trying to track down something like this for a while now. So when/if I change archives links to particular posts will be flexible and change as well. Used... Read More

Future Proofing Entries from the epitome of ambiguity on February 20, 2005 12:12 AM

Odd you may say, but I don't think so. I've been trying to track down something like this for a while now. So when/if I change archives links to particular posts will be flexible and change as well. Used... Read More

Future Proofing Entries from the epitome of ambiguity on February 20, 2005 12:14 AM

Odd you may say, but I don't think so. I've been trying to track down something like this for a while now. So when/if I change archives links to particular posts will be flexible and change as well. Used... Read More

I hadn't done any real back-end work on this blog for ages now, but today I went nuts downloading and installing new Movable Type plug-ins.... Read More

4 Comments

With MT-Textile 2 (still in beta, but coming along), this becomes even simpler:

"This":125 is a link to the entry with the id of 125

This requires two plugins. Using the MTEntry plug, that's all you need. No need for macros or anything else.

Um, MTEntry is the same plugin that David refers to as "Entry" - and he wrote it. =)

If you only used MTEntry, then how would the tags in your entries get processed? You'd need the Process Tags plugin for that.

So you're back to two plugins.

Simple question from a simple mind... How do I "set up" the macro, uh where do I do that?

thanks!

Leave a comment

Recent Entries

  • Plugin Writing 101

    So, I’m planning on writing up some entries about various aspects of plugin development. While I have a couple topics already in mind, I thought...

  • The Olympics Make Me Want To Compete Again

    Every time the Olympics come around (most the summer ones) I always start to delude myself into thinking I could complete once again in the...

  • Minimalist plugins are fun!

    Last night I whipped up one of the smallest plugins I’ve ever written. It is so small in fact that I was able to stuff...

  • Feedburner Widget on MT News

    Movable Type News A WordPress 2.5 Upgrade Guide: And of course there are lots of third-party plugins for the MT dashboard, to integrate statistics and...

  • AD&D Monster Stats for the Presidential Canditates

    Charles Stross (scifi author, D&D nerd, and former perl columnist) posted Politics as she is Played with 3d6: The recent death of Gary Gygax, who...

Close