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

  • Pitching Bloggers Forget what you learned in your PR classes. Start acting like a human instead of a marketer, and the humans behind the blogs will respond.
  • Debunking predictions Read/Write Web's authors have some goofy predictions.
  • Google on the desktop Google picks up Picasa, giving them an important foothold on people's PCs.
  • Best of Newly Digital There have been dozens of Newly Digital entries from all over the world. Here are some of the best.
  • Rounded corners in CSS There lots of ways to create rounded corners with CSS, but they always require lots of complex HTML and CSS. This is simpler.
  • More of the best »

Recently Read

Get More

Subscribe | Archives

16

Recently

Networking as an entrepreneur (Oct 23)
Having a network is crazy important. Networking is not.
Stretching your team (Jun 11)
Stretching your team is one of the best ways to improve your output, your team's happiness, and your velocity. But they'll need coaching.
Physical camera shutter for Cisco Spark Board (Jul 6)
A 3d printable design for a camera shutter for a Cisco Spark Board
My Travel Coffee Setup (Jan 20)
What my travel coffee brewing setup looks like, and how you can build your own for under $100.
Turkey Legs (May 30)
Product naming gone awry.
Speaking for Geeks: Your Slides (Dec 17)
Tips and tricks for creating great slides.
Speaking for Geeks: Writing Your Talk (Dec 14)
Don’t wait until the night before the talk to write it. Crazy, I know.
Speaking for Geeks: Tell a Story (Dec 13)
Telling a story keeps your presentation focused, keeps your audience interested, and makes it easier for you to remember your talk.

Subscribe to this site's feed.

Elsewhere

Tropo
Voice and communications platforms, including Tropo and Phono. Work.
SacStarts
The Sacramento technology startup community.
Pinewood Freak
Pinewood Derby tips and tricks

Contact

Adam Kalsey

Mobile: 916.600.2497

Email: adam AT kalsey.com

AIM or Skype: akalsey

Resume

PGP Key

©1999-2018 Adam Kalsey.
Content management by Movable Type.