Related Entries Plugin

Freshness Warning
This article is over 16 years old. It's possible that the information you read below isn't current.

Related Entries is a plugin for Movable Type that displays entries that are in the same category as the current entry.

If you place your entries in categories, you can use this tag provide your readers with the same sort of "Related Articles" feature that is often found on magazine and news sites.

Tim Appnel has taken over the maintenance and support of this plugin as of Oct 2004.

Download. You can get Related Entries by downloading RelatedEntries.zip.

Installation. Once you’ve downloaded and unzipped RelatedEntries.zip, connect to your FTP server and open the directory where you have Movable Type installed.

Create a directory there called plugins if there isn’t one already.

Copy RelatedEntries.pl to the plugins directory and set the permissions to 755.

Using Related Entries. Once you’ve installed Related Entries, using it is as simple as placing a new Movable Type tag in your template.

The <MTRelatedEntries> tag is a container tag. It requires an opening and closing tag, just like the built-in MTEntries tag. Related Entries only works in an individual archive template.

To insert related entries into your individual archives, put the MTRelatedEntries container in your template, and then put an MTEntries tag block inside of it.

Example:

<MTRelatedEntries>
<MTEntries lastn="3">
<p><a href="<MTEntryLink>"><MTEntryTitle></a> -
<i><$MTEntryDate format="%b %d, %Y"$></i></p>
</MTEntries>
</MTRelatedEntries>

License. Like our other freeware, this plugin is released under the open-source MIT License. In plain English, that means you can do whatever you want with the software, including modifying it, selling it, or eating it, but we’re not responsible for anything that goes wrong.

Revision History
1.0 - July 6, 2002
Initial release.

1.1 - July 8, 2002
(New) If Related Entries is used outside your individual archives, you are now warned when you try to rebuild.

John Hoke
July 22, 2003 3:23 PM

Sorry, I really had to remove the plugin until I could figgure out why it was returning such old entries even after a full rebuild so the link above wont show the issue anymore -john

Dave
July 28, 2003 9:34 PM

Thanks so much for your hard work. I used Dean peter's work around and it is awesome. Please keep up the good work.

Trackback from Bomber0@NeT
August 6, 2003 12:48 AM

Related Entries

Excerpt: This Blog equipped the Kalsey's Related Entries.. http://www.kalsey.com/2002/07/related_entries_plugin/...

Barbara Lynn
September 8, 2003 3:43 PM

I would like to add a bullet such as: → before each link, remove the date and have a line break at the end of each entry ala recent posts. I get cms hash undefined error message which happens when I alter the code in the ind. archives template. All I did was remove the date and accompaning 1 and p tag. add a br to the end of the a href tag and enclosed in bold tags → before the a href tag. Sice this post doesnt accept html I cant post the actual code sample. bkynn blynn

Adam Kalsey
September 8, 2003 3:46 PM

You are probably getting the "line 19" message. Look through the comments for a fix.

Ronaldo
October 19, 2003 5:57 PM

Firstly, thanks for the plugin. It's a very nice piece of work. I've been using it since I installed MT and it has served me well. Just a question... Has the problem reported in the comments above about a splice offset past the end of array in line 77 been solved? I ask because I just upgraded to MT 2.64 while moving to a new hosting provider, and I'm consistently getting this error on some entries. The error effectively prevents the entry from being rebuilt, and it seems to happen when the entry has fewer related entried than specified in the plugin parameters.

Alan
November 12, 2003 12:14 PM

There are two bugs in the Perl script: a. use of uninitialized value in line 19; b. splice extending past the end of the array. Here are the diffs to fix the script: --- /home/aks/RelatedEntries.pl Tue Dec 17 11:12:44 2002 +++ RelatedEntries.pl Wed Nov 12 12:10:24 2003 @@ -16,7 +16,10 @@ my($ctx, $args) = @_; use MT::Entry; use MT::Placement; - my $method = (length($args->{field}) > 0) ? $args->{field} : "primary_category"; + my $method = (%args + && exists($args->{field}) + && length($args->{field}) > 0) + ? $args->{field} : "primary_category"; my $blog_id = $ctx->stash('blog_id'); defined(my $ctx_entry = $ctx->stash('entry')) or return $ctx->error("No entry found. Perhaps you used outside your ind ividual archive?"); @@ -74,7 +77,7 @@ }) or return ''; push(@entries, @entriesNew); - splice(@entries, $lastn); + splice(@entries, $lastn) if $lastn id == $id; # it's own Related list @@ -107,4 +110,4 @@ } } return "25"; -} +}

Colin
November 21, 2003 8:32 AM

Great plugin. Thanks. Being picky, could you help me to stop it inserting a line space between each of the related entries? Its taking up a lot of room.

eouia
December 4, 2003 11:42 AM

It's odd. It works well in some categories, doesn't in others. what's the problem? i can't figure out. in bad cases, this plugin shows some related entries in their category. but, they are not recent. some "related" entries are too old-dated, not recent.

Nick
July 29, 2004 1:53 PM

Righteous Plugin... but I can't get that patch to work, when I run it I get - Patching file RelatedEntries.pl using Plan A... patch: **** malformed patch at line 4: my($ctx, $args) = @_; Anyone else suffer this fate? I wouldn't care about those line 19 errors, but this is for a client who will get nervous if he sees 'em

Moloko
August 30, 2004 2:36 AM

Hello. Great plug-in! But: there is a way to show the current post in the "related post" and have it not clickable? I need it for a list of products, the list should be the same, but i don't wont the link to the product i'm looking. thanks M

Trackback from お知らせ
October 26, 2004 1:06 AM

Related Entries Plugin を導入

Excerpt: Related Entries Pluginより。 ニュースサイトのように関連記事を表示したかったので導入してみました。...

Trackback from マガジーンズ・技術フォーラム
October 29, 2004 12:43 AM

自サイト内の関連記事を拾うプラグイン

Excerpt: 自ブログ内の関連する記事を 自動で拾う方法はないかと、考えていました。 カテゴリで区切ってある程度は うまくいきますが 忘れている記事や、同じようなタイトル、また連載の...

Trackback from BlogFirefox
January 3, 2005 1:41 AM

Related Entries Plugin

Excerpt: 利用Keyword来进行MT的「关联文章」的表示方法已经有介绍了。今天又看到了一...

surfer
January 11, 2005 7:40 AM

I just install your plugin (MT3.14), but I get this error: Use of uninitialized value in length at /Library/WebServer/CGI-Executables/plugins/RelatedEntries.pl line 19. splice() offset past end of array at /Library/WebServer/CGI-Executables/plugins/RelatedEntries.pl line 77. What must I do? Thanks.

These are the last 15 comments. Read all 78 comments here.

This discussion has been closed.

Follow me on Twitter

Best Of

  • California State Fair The California State Fair lets you buy tickets in advance from their Web site. That's good. But the site is a horror house of usability problems.
  • Best of Newly Digital There have been dozens of Newly Digital entries from all over the world. Here are some of the best.
  • How not to apply for a job Applying for a job isn't that hard, but it does take some minimal effort and common sense.
  • Newly Digital Newly Digital is an experimental writing project. I've asked 11 people to write about their early experiences with computing technology and post their essays on their weblogs. So go read, enjoy, and then contribute. This collection is open to you. Write up your own story, and then let the world know about it.
  • Lock-in is bad T-Mobile thinks they'll get new Hotspot customers with exclusive content and locked-in devices.
  • More of the best »

Recently Read

Get More

Subscribe | Archives

Recently

Encouraging 1:1s from other managers in your organization (Jan 4)
If you’re managing other managers, encourage them to hold their own 1:1s. It’s such an important tool for managing and leading that everyone needs to be holding them.
One on One Meetings - a collection of posts about 1:1s (Jan 2)
A collection of all my writing on 1:1s
Are 1:1s confidential? (Jan 2)
Is the discussion that occurs in a 1:1 confidential, even if no agreed in the meeting to keep it so?
Skip-level 1:1s are your hidden superpower (Jan 1)
Holding 1:1s with peers and with people far below you on the reporting chain will open your eyes up to what’s really going on in your business.
Do you need a 1:1 if you’re regularly communicating with your team? (Dec 28)
You’re simply not having deep meaningful conversation about the process of work in hallway conversations or in your chat apps.
What agenda items should a manager bring to a 1:1? (Dec 23)
At least 80% of a 1:1 agenda should be driven by your report, but if you also to use this time to work on things with them, then you’ll have better meetings.
Handling “I don’t have anything to talk about” in your 1:1s (Dec 21)
When someone says they have nothing to discuss, they’re almost always thinking too narrowly.
What should you talk about in a 1:1? (Dec 19)
Who sets the agenda? What should you discuss, and what should you avoid discussing?

Subscribe to this site's feed.

Contact

Adam Kalsey

Mobile: 916.600.2497

Email: adam AT kalsey.com

Twitter, etc: akalsey

Resume

PGP Key

©1999-2019 Adam Kalsey.