Need someone to lead product management at your software company? I create software for people that create software and I'm looking for my next opportunity. Check out my resume and get in touch.

Related Entries Plugin

Freshness Warning
This blog post is over 21 years old. It's possible that the information you read below isn't current and the links no longer work.

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.

Recently Written

Mastery doesn’t come from perfect planning (Dec 21)
In a ceramics class, one group focused on a single perfect dish, while another made many with no quality focus. The result? A lesson in the value of practice over perfection.
The Dark Side of Input Metrics (Nov 27)
Using input metrics in the wrong way can cause unexpected behaviors, stifled creativity, and micromanagement.
Reframe How You Think About Users of your Internal Platform (Nov 13)
Changing from "Customers" to "Partners" will give you a better perspective on internal product development.
Measuring Feature success (Oct 17)
You're building features to solve problems. If you don't know what success looks like, how did you decide on that feature at all?
How I use OKRs (Oct 13)
A description of how I use OKRs to guide a team, written so I can send to future teams.
Build the whole product (Oct 6)
Your code is only part of the product
Input metrics lead to outcomes (Sep 1)
An easy to understand example of using input metrics to track progress toward an outcome.
Lagging Outcomes (Aug 22)
Long-term things often end up off a team's goals because they can't see how to define measurable outcomes for them. Here's how to solve that.

Older...

What I'm Reading

Contact

Adam Kalsey

+1 916 600 2497

Resume

Public Key

© 1999-2024 Adam Kalsey.