« MTSplitLoop | Main | First Neverwinter Nights Expansion Goes Gold! »

May 30, 2003

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.

Posted by rayners at May 30, 2003 03:04 PM

Trackback Pings

TrackBack URL for this entry:
http://mt.rayners.org/mt-tb.cgi/207

Listed below are links to weblogs that reference How To Prevent Link-Rot in Movable Type or How To Easily Link To An Entry:

» link_entry easily from lovelinks
David Raynes: How To Prevent Link-Rot in Movable Type or How To Easily Link To An Entry (uses Entry and... [Read More]

Tracked on June 5, 2003 05:09 PM

» http://www.almaren.ch/internotes/archives/week_2003_09_21.html#002016 from Internotes
David Raynes: How To Prevent Link-Rot in Movable Type or How To Easily Link To An Entry [Read More]

Tracked on September 26, 2003 08:39 AM

» Link Rot from Radio Free Blogistan
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]

Tracked on November 7, 2003 01:20 AM

» Link Rot from Radio Free Blogistan
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]

Tracked on November 7, 2003 01:23 AM

» Link Rot from Radio Free Blogistan
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]

Tracked on November 7, 2003 01:24 AM

» Link Rot from Radio Free Blogistan
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]

Tracked on November 7, 2003 01:37 AM

» Link Rot from Radio Free Blogistan
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]

Tracked on November 7, 2003 01:39 AM

» Link Rot from Radio Free Blogistan
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]

Tracked on November 7, 2003 01:51 AM

» Link Rot from Radio Free Blogistan
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]

Tracked on November 7, 2003 03:15 AM

» Link Rot from Radio Free Blogistan
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]

Tracked on November 8, 2003 02:20 AM

» Grokking MT and Link Rot from random ruminations
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]

Tracked on April 21, 2004 11:35 AM

» Future Proofing Entries from the epitome of ambiguity
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]

Tracked on February 19, 2005 11:41 PM

» Future Proofing Entries from the epitome of ambiguity
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]

Tracked on February 20, 2005 12:04 AM

» Future Proofing Entries from the epitome of ambiguity
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]

Tracked on February 20, 2005 12:04 AM

» Future Proofing Entries from the epitome of ambiguity
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]

Tracked on February 20, 2005 12:08 AM

» Future Proofing Entries from the epitome of ambiguity
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]

Tracked on February 20, 2005 12:12 AM

» Future Proofing Entries from the epitome of ambiguity
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]

Tracked on February 20, 2005 12:14 AM

» plug one plug two from gallimaufry
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]

Tracked on April 19, 2005 09:34 PM

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

Posted by: Brad Choate at May 30, 2003 03:16 PM

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

Posted by: AMK44 at May 30, 2003 05:13 PM

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.

Posted by: girlie at May 30, 2003 08:35 PM

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

thanks!

Posted by: Megan at May 31, 2003 12:25 AM

Post a comment




Remember Me?

(you may use HTML tags for style)